From 4000bc3be58eda7bae56460eeb2c451a8086f05b Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Jan 2020 20:01:38 +0200 Subject: [PATCH] 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 --- config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.45.0