counters: Ensure name_wid[0] is initialized to zero

I was seeing some segfaults and other weirdness without this.

Signed-off-by: Andy Grover <agrover@versity.com>
This commit is contained in:
Andy Grover
2021-01-12 16:29:42 -08:00
parent 7befc61482
commit f35154eb19
+1
View File
@@ -120,6 +120,7 @@ static int counters_cmd(int argc, char **argv)
goto out;
}
memset(&ctrs[nr], 0, (alloced - nr) * sizeof(*ctrs));
memset(&name_wid[nr], 0, (alloced - nr) * sizeof(*name_wid));
}
ctr = &ctrs[nr];