]> granicus.if.org Git - shadow/commitdiff
get_map_ranges: initialize argidx to 0 at top of loop
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 6 Aug 2015 05:34:17 +0000 (00:34 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 6 Aug 2015 05:34:25 +0000 (00:34 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
libmisc/idmapping.c

index 34de3ce518d119b95ff6a662938c384c0ebfb332..0dce634d0825c0081cf7ca1217f471cd5cab7a83 100644 (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;