]> granicus.if.org Git - vnstat/commitdiff
fix compiler warnings (gcc 8.2.0 and clang 8.0.0)
authorTeemu Toivola <git@humdi.net>
Fri, 19 Oct 2018 21:18:10 +0000 (00:18 +0300)
committerTeemu Toivola <git@humdi.net>
Fri, 19 Oct 2018 21:18:10 +0000 (00:18 +0300)
src/image.c
tests/image_tests.c

index ef4883fa4faf4a3612920ff30058a923d18dabbf..3925e29cab66d45d657f3b6b4eab325b51691ccb 100644 (file)
@@ -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);
index 91e6ef70ef8bc93ae8f5414505d0db721a43e989..3be2f20f4a98271b79eef01995701c541cc40efc 100644 (file)
@@ -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;