1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Make sure to copy the null terminator at the end of the argv list. Some

programs use it instead of argc.

llvm-svn: 11270
This commit is contained in:
Chris Lattner 2004-02-10 19:14:44 +00:00
parent 11a3e8f8d7
commit 482511755f

View File

@ -41,7 +41,7 @@ int save_arguments(int argc, const char **argv) {
* what to do with it.
*/
const char *Arg = argv[1];
memmove(&argv[1], &argv[2], (argc-2)*sizeof(char*));
memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
--argc;
if (!strcmp(Arg, "-llvmprof-output")) {
@ -49,7 +49,7 @@ int save_arguments(int argc, const char **argv) {
puts("-llvmprof-output requires a filename argument!");
else {
OutputFilename = strdup(argv[1]);
memmove(&argv[1], &argv[2], (argc-2)*sizeof(char*));
memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*));
--argc;
}
} else {