Use const, to support platforms where strrchr returns a const char *.
authorDan Gohman <gohman@apple.com>
Tue, 10 Feb 2009 17:56:28 +0000 (17:56 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 10 Feb 2009 17:56:28 +0000 (17:56 +0000)
This fixes PR3535.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64224 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Signals.inc

index 9c1050cf8a0fa07b84e03e12754a9fa7d1f922e0..e42841263ea14b9ed323d245b190646f97b5ab0c 100644 (file)
@@ -78,7 +78,7 @@ static void PrintStackTrace() {
   for (int i = 0; i < depth; ++i) {
     Dl_info dlinfo;
     dladdr(StackTrace[i], &dlinfo);
-    char* name = strrchr(dlinfo.dli_fname, '/');
+    const char* name = strrchr(dlinfo.dli_fname, '/');
 
     int nwidth;
     if (name == NULL) nwidth = strlen(dlinfo.dli_fname);
@@ -93,7 +93,7 @@ static void PrintStackTrace() {
 
     fprintf(stderr, "%-3d", i);
 
-    char* name = strrchr(dlinfo.dli_fname, '/');
+    const char* name = strrchr(dlinfo.dli_fname, '/');
     if (name == NULL) fprintf(stderr, " %-*s", width, dlinfo.dli_fname);
     else              fprintf(stderr, " %-*s", width, name+1);