summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3aeea86)
raw | patch | inline | side by side (parent: 3aeea86)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 28 Jul 2014 13:12:42 +0000 (15:12 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 28 Jul 2014 13:12:42 +0000 (15:12 +0200) |
also avoid recycling the previous iterator, for the sake of better code
understanding.
understanding.
src/zfs_arc.c | patch | blob | history |
diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index 168d566bb47ff406f0deb183c5c9d7550211e969..b784ee3a3fc1374a66e03f12b432c625ae48dce1 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
- i = 0;
+ int j = 0;
pnl = file_contents;
while (pnl != NULL)
numfields = strsplit (pnl, fields, 4);
if (numfields == 3)
{
- llvalues[i] = atoll (fields[2]);
+ llvalues[j] = atoll (fields[2]);
- e = llentry_create (fields[0], &llvalues[i]);
+ e = llentry_create (fields[0], &llvalues[j]);
if (e == NULL)
{
ERROR ("zfs_arc plugin: `llentry_create' failed.");
{
llist_append (ksp, e);
}
+ j++;
}
pnl = pnnl;
if (pnl != NULL)