This commit was generated by cvs2svn to compensate for changes in r2587,
[iproute2.git] / misc / lnstat_util.c
index 6ff3779..59c5e96 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;
 }