From: Teemu Toivola Date: Fri, 19 Oct 2018 21:18:10 +0000 (+0300) Subject: fix compiler warnings (gcc 8.2.0 and clang 8.0.0) X-Git-Tag: v2.0~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cc8975141fda0ec5d02629c7a673ba038fdcc2c;p=vnstat fix compiler warnings (gcc 8.2.0 and clang 8.0.0) --- diff --git a/src/image.c b/src/image.c index ef4883f..3925e29 100644 --- a/src/image.c +++ b/src/image.c @@ -1100,7 +1100,7 @@ void drawsummary(IMAGECONTENT *ic, int type, int rate) d = localtime(&ic->interface.created); strftime(datebuff, 16, cfg.tformat, d); snprintf(daytemp, 24, "since %s", datebuff); - snprintf(buffer, 24, "%23s", daytemp); + snprintf(buffer, 32, "%23s", daytemp); gdImageString(ic->im, gdFontGetSmall(), textx-48, texty+70, (unsigned char*)buffer, ic->ctext); drawlegend(ic, 410, 155-headermod); diff --git a/tests/image_tests.c b/tests/image_tests.c index 91e6ef7..3be2f20 100644 --- a/tests/image_tests.c +++ b/tests/image_tests.c @@ -625,7 +625,7 @@ START_TEST(element_output_check) gdImageStringUp(ic.im, gdFontGetSmall(), 1, y+15, (unsigned char*)"50.0%", ic.ctext); - for (i=50.0; i>=0; i-=0.2) { + for (i=50.0; i>=0; i-=(float)0.2) { drawdonut(&ic, x, y, i, i); x += 55;