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': ",