]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_interrupts.c
improvements identified via static code analysis with cppcheck
[netdata.git] / src / proc_interrupts.c
index c652693a7273af4174dc43264e559c04c224d787..14215de68a24f497f208f72694ddffb60fe692cf 100644 (file)
@@ -52,7 +52,7 @@ int do_proc_interrupts(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 = procfile_linewords(ff, 0), w;
+    uint32_t words = procfile_linewords(ff, 0);
 
     if(unlikely(!lines)) {
         error("Cannot read /proc/interrupts, zero lines reported.");
@@ -61,6 +61,7 @@ int do_proc_interrupts(int update_every, unsigned long long dt) {
 
     // find how many CPUs are there
     if(unlikely(cpus == -1)) {
+        uint32_t w;
         cpus = 0;
         for(w = 0; w < words ; w++) {
             if(unlikely(strncmp(procfile_lineword(ff, 0, w), "CPU", 3) == 0))