Use const, to support platforms where strrchr returns a const char *.

This fixes PR3535.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-02-10 17:56:28 +00:00
parent cfbcd591d2
commit d4e1845849

View 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);