[llvm-commits] CVS: llvm/runtime/libprofile/CommonProfiling.c

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 10 13:15:01 PST 2004


Changes in directory llvm/runtime/libprofile:

CommonProfiling.c updated: 1.5 -> 1.6

---
Log message:

Make sure to copy the null terminator at the end of the argv list.  Some 
programs use it instead of argc.


---
Diffs of the changes:  (+2 -2)

Index: llvm/runtime/libprofile/CommonProfiling.c
diff -u llvm/runtime/libprofile/CommonProfiling.c:1.5 llvm/runtime/libprofile/CommonProfiling.c:1.6
--- llvm/runtime/libprofile/CommonProfiling.c:1.5	Tue Feb 10 12:01:00 2004
+++ llvm/runtime/libprofile/CommonProfiling.c	Tue Feb 10 13:14:44 2004
@@ -41,7 +41,7 @@
      * 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 @@
         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 {





More information about the llvm-commits mailing list