mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-19 19:31:50 +00:00
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:
parent
cfbcd591d2
commit
d4e1845849
@ -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