From: Timo Kokkonen Date: Wed, 29 Jan 2020 18:01:38 +0000 (+0200) Subject: config: Fix "specified bound 16 equals destination size" warning X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=4000bc3be58eda7bae56460eeb2c451a8086f05b config: Fix "specified bound 16 equals destination size" warning Just subtract one byte off the strncpy destination size and the null byte will always fit. Signed-off-by: Timo Kokkonen --- diff --git a/config.c b/config.c index 81ba188..fec0454 100644 --- a/config.c +++ b/config.c @@ -129,11 +129,11 @@ static int parse_images(config_setting_t *list, struct rrd_database *db) db->images[i]->width = width; db->images[i]->height = height; strncpy(db->images[i]->timestart, timestart, - sizeof(db->images[i]->timestart)); + sizeof(db->images[i]->timestart) - 1); strncpy(db->images[i]->timeend, timeend, - sizeof(db->images[i]->timeend)); + sizeof(db->images[i]->timeend) - 1); strncpy(db->images[i]->imageformat, imageformat, - sizeof(db->images[i]->imageformat)); + sizeof(db->images[i]->imageformat) - 1); db->images[i]->options = options; db->images[i]->text_lead = text_lead; db->images[i]->text = text;