]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Fix sum of first field (entries).
authorosdl.net!shemminger <osdl.net!shemminger>
Fri, 18 Mar 2005 19:40:19 +0000 (19:40 +0000)
committerosdl.net!shemminger <osdl.net!shemminger>
Fri, 18 Mar 2005 19:40:19 +0000 (19:40 +0000)
(Logical change 1.172)

misc/lnstat_util.c

index f99e939ed7accd4dac05c5ac396902c5b05b4bc1..4127100dbe36462c7efc69f66e44e1fc79f152a3 100644 (file)
@@ -52,8 +52,13 @@ static int scan_lines(struct lnstat_file *lf, int i)
                fgets(buf, sizeof(buf)-1, lf->fp); 
                gettimeofday(&lf->last_read, NULL);
 
-               for (j = 0; j < lf->num_fields; j++)
-                       lf->fields[j].values[i] += strtoul(ptr, &ptr, 16);
+               for (j = 0; j < lf->num_fields; j++) {
+                       unsigned long f = strtoul(ptr, &ptr, 16);
+                       if (j == 0) 
+                               lf->fields[j].values[i] += f;
+                       else
+                               lf->fields[j].values[i] += f;
+               }
        }
        return num_lines;
 }