get_map_ranges: initialize argidx to 0 at top of loop

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2015-08-06 00:34:17 -05:00
parent 7edb32e75f
commit 533d2bab3d

View File

@ -70,7 +70,7 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
/* Gather up the ranges from the command line */
mapping = mappings;
for (idx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
for (idx = 0, argidx = 0; idx < ranges; idx++, argidx += 3, mapping++) {
if (!getulong(argv[argidx + 0], &mapping->upper)) {
free(mappings);
return NULL;