From: Timo Kokkonen Date: Sat, 9 Jul 2016 10:19:02 +0000 (+0300) Subject: rrdtool_draw_image: Remove excess strlen() call X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=48d822f43167e9ea765ae7de341eeef8de07a013 rrdtool_draw_image: Remove excess strlen() call strncat is already good enough ensuring target buffer will not overflow. There is no need to use strlen at all. Signed-off-by: Timo Kokkonen --- diff --git a/rrdtool.c b/rrdtool.c index c875417..9fed184 100644 --- a/rrdtool.c +++ b/rrdtool.c @@ -48,8 +48,8 @@ int rrdtool_draw_image(struct rrd_image *image) pr_info("Drawing image %s\n", image->image_filename); tmpfile[0] = 0; - strncat(tmpfile, image->image_filename, sizeof(tmp) - strlen(tmp) - 1); - strncat(tmpfile, ".tmp", sizeof(tmp) - strlen(tmp) - 1); + strncat(tmpfile, image->image_filename, sizeof(tmp) - 1); + strncat(tmpfile, ".tmp", sizeof(tmp) - 1); if (image->updatestr) updatestr = image->updatestr;