this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Creating Default Output Path If File Is Not In CWD

Thomas A b23cfe93 7e4c0fd8

+6 -1
+6 -1
src/hosttools/src/coredump/main.c
··· 8 8 #include <errno.h> 9 9 #include <sys/stat.h> 10 10 #include <pwd.h> 11 + #include <libgen.h> 11 12 12 13 #include <mach-o/loader.h> 13 14 #include <elf.h> ··· 168 169 return 1; 169 170 } 170 171 171 - if (snprintf(default_output_name, sizeof(default_output_name), "darlingcore-%s", argv[1]) < 0) { 172 + char *tmp_output_dirname = strdup(argv[1]); 173 + char *tmp_output_basename = strdup(argv[1]); 174 + if (snprintf(default_output_name, sizeof(default_output_name), "%s/darlingcore-%s", dirname(tmp_output_dirname), basename(tmp_output_basename)) < 0) { 172 175 perror("snprintf"); 173 176 return 1; 174 177 } 178 + free(tmp_output_dirname); tmp_output_dirname = NULL; 179 + free(tmp_output_basename); tmp_output_basename = NULL; 175 180 176 181 const char* homedir = NULL; 177 182