diff options
-rw-r--r-- | runtime/libprofile/GCDAProfiling.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/runtime/libprofile/GCDAProfiling.c b/runtime/libprofile/GCDAProfiling.c index 233a2f3..ea2a56a 100644 --- a/runtime/libprofile/GCDAProfiling.c +++ b/runtime/libprofile/GCDAProfiling.c @@ -114,11 +114,8 @@ void llvm_gcda_start_file(const char *orig_filename) { output_file = fopen(filename, "wb"); if (!output_file) { - const char *cptr = 0; - filename[0] = '\0'; /* The size of filename should be big enough. */ - cptr = strrchr(orig_filename, '/'); - strcat(filename, cptr ? cptr + 1 : orig_filename); - output_file = fopen(filename, "wb"); + const char *cptr = strrchr(orig_filename, '/'); + output_file = fopen(cptr ? cptr + 1 : orig_filename, "wb"); if (!output_file) { fprintf(stderr, "LLVM profiling runtime: while opening '%s': ", |