Patch by Stewart Brodie to terminate the string array correctly

This commit is contained in:
Glenn L McGrath 2003-01-08 03:26:47 +00:00
parent e40500f9cb
commit a69fd2ecf6

View File

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