]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_meminfo.c
improvements identified via static code analysis with cppcheck
[netdata.git] / src / proc_meminfo.c
index 0e5e14fd20e9d91b0015718a2552cac69fb812cf..11b41be7bd3dc7ce9d178ce5a4fa3541fe6bfcc3 100644 (file)
@@ -114,7 +114,6 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
         return 0; // we return 0, so that we will retry to open it next time
 
     uint32_t lines = procfile_lines(ff), l;
-    uint32_t words;
 
     int hwcorrupted = 0;
 
@@ -162,7 +161,7 @@ int do_proc_meminfo(int update_every, unsigned long long dt) {
             HardwareCorrupted = 0;
 
     for(l = 0; l < lines ;l++) {
-        words = procfile_linewords(ff, l);
+        uint32_t words = procfile_linewords(ff, l);
         if(unlikely(words < 2)) continue;
 
         char *name = procfile_lineword(ff, l, 0);