mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Use const, to support platforms where strrchr returns a const char *.
This fixes PR3535. llvm-svn: 64224
This commit is contained in:
parent
abede9d54b
commit
6a9be2e4ea
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user