From: Serge Hallyn Date: Thu, 6 Aug 2015 05:34:17 +0000 (-0500) Subject: get_map_ranges: initialize argidx to 0 at top of loop X-Git-Tag: 4.3.0~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9%2Fhead;p=thirdparty%2Fshadow.git get_map_ranges: initialize argidx to 0 at top of loop Signed-off-by: Serge Hallyn --- diff --git a/libmisc/idmapping.c b/libmisc/idmapping.c index 34de3ce51..0dce634d0 100644 --- a/libmisc/idmapping.c +++ b/libmisc/idmapping.c @@ -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;