Commit f5f1a6c5 authored by osdl.net!shemminger's avatar osdl.net!shemminger

Fix sum of first field (entries).

(Logical change 1.172)
parent e796b958
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment