Patch by Stewart Brodie to terminate the string array correctly
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 8 Jan 2003 03:26:47 +0000 (03:26 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 8 Jan 2003 03:26:47 +0000 (03:26 -0000)
debianutils/run_parts.c

index 34e702ef83f98901eb3f2e8596e4911a3158af6f..a6ad81096d24f26771c173f2347aac045db0b3fe 100644 (file)
@@ -88,7 +88,6 @@ int run_parts_main(int argc, char **argv)
                         * Called once for every argument. */
                        args = xrealloc(args, (argcount + 2) * (sizeof(char *)));
                        args[argcount++] = optarg;
-                       args[argcount] = 0;
                        break;
                default:
                        show_usage();
@@ -101,5 +100,7 @@ int run_parts_main(int argc, char **argv)
        }
 
        args[0] = argv[optind];
+       args[argcount] = 0;
+
        return(run_parts(args, test_mode));
 }