]> granicus.if.org Git - vnstat/commitdiff
fix clang -Wsign-conversion
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 1 Mar 2018 15:26:18 +0000 (16:26 +0100)
committerChristian Göttsche <cgzones@googlemail.com>
Sun, 4 Mar 2018 12:58:16 +0000 (13:58 +0100)
src/ifinfo.c:329:31: error: implicit conversion changes signedness: 'int32_t' (aka 'int') to 'unsigned long' [-Werror,-Wsign-conversion]
                if (data.btime < (btime-cfg.bvar)) {

src/ifinfo.c

index 8565307175571742fdee95fd005bcc3f2b034efe..042443622b3b34476c76d8e6c1b68b8b29d60266 100644 (file)
@@ -326,7 +326,7 @@ void parseifinfo(int newdb)
 
                /* btime in /proc/stat seems to vary ±1 second so we use btime-BVAR just to be safe */
                /* the variation is also slightly different between various kernels... */
-               if (data.btime < (btime-cfg.bvar)) {
+               if (data.btime < (btime-(unsigned)cfg.bvar)) {
                        data.currx=0;
                        data.curtx=0;
                        if (debug)