]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_net_stat_conntrack.c
improvements identified via static code analysis with cppcheck
[netdata.git] / src / proc_net_stat_conntrack.c
index b1fc1f3313367509bdfc03018bfc2098a94bbece..807a9baeb828de677120713db2889c5bb949f99b 100644 (file)
@@ -31,13 +31,12 @@ int do_proc_net_stat_conntrack(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;
 
     unsigned long long aentries = 0, asearched = 0, afound = 0, anew = 0, ainvalid = 0, aignore = 0, adelete = 0, adelete_list = 0,
         ainsert = 0, ainsert_failed = 0, adrop = 0, aearly_drop = 0, aicmp_error = 0, aexpect_new = 0, aexpect_create = 0, aexpect_delete = 0, asearch_restart = 0;
 
     for(l = 1; l < lines ;l++) {
-        words = procfile_linewords(ff, l);
+        uint32_t words = procfile_linewords(ff, l);
         if(unlikely(words < 17)) {
             if(unlikely(words)) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %u.", words);
             continue;