aboutsummaryrefslogtreecommitdiff
path: root/runtime/libprofile
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-03-28 01:30:51 +0000
committerBill Wendling <isanbard@gmail.com>2012-03-28 01:30:51 +0000
commit7242a4fb86d9b369a467e3a85ce02bc94c6d9dc8 (patch)
tree540ff28003a813bcc615aed942959a582eb38eca /runtime/libprofile
parent5ca6b02d22442a8b55a523d42981e026b3b07dcb (diff)
Use Nakamura's suggestion of bypassing using 'filename' and just the pointers directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/libprofile')
-rw-r--r--runtime/libprofile/GCDAProfiling.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/runtime/libprofile/GCDAProfiling.c b/runtime/libprofile/GCDAProfiling.c
index 233a2f390f..ea2a56a8b0 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': ",