diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-10 19:14:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-10 19:14:44 +0000 |
commit | f472935caf4d6f188852e4b9311c05897029b61f (patch) | |
tree | d2c1c12c7a39b7fa38a746a7a537170a825db2fd | |
parent | 991c76ca97440de555b4129c8016614826b081f1 (diff) | |
download | external_llvm-f472935caf4d6f188852e4b9311c05897029b61f.zip external_llvm-f472935caf4d6f188852e4b9311c05897029b61f.tar.gz external_llvm-f472935caf4d6f188852e4b9311c05897029b61f.tar.bz2 |
Make sure to copy the null terminator at the end of the argv list. Some
programs use it instead of argc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11270 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | runtime/libprofile/CommonProfiling.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/libprofile/CommonProfiling.c b/runtime/libprofile/CommonProfiling.c index 7e9e12e..aeb9c60 100644 --- a/runtime/libprofile/CommonProfiling.c +++ b/runtime/libprofile/CommonProfiling.c @@ -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 { |