Don't run cli_cleanup_files() in cli_fatal if theres no rootdir

This commit is contained in:
Joris Vink 2014-08-01 16:39:12 +02:00
parent 5fa964c5c0
commit 448f1a7912
1 changed files with 8 additions and 5 deletions

View File

@ -715,11 +715,14 @@ cli_fatal(const char *fmt, ...)
(void)vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
l = snprintf(spath, sizeof(spath), "%s/.objs", rootdir);
if (l == -1 || (size_t)l >= sizeof(spath)) {
printf("couldn't create spath for cleanup: %s\n", errno_s);
} else {
cli_cleanup_files(spath);
if (rootdir != NULL) {
l = snprintf(spath, sizeof(spath), "%s/.objs", rootdir);
if (l == -1 || (size_t)l >= sizeof(spath)) {
printf("couldn't create spath for cleanup: %s\n",
errno_s);
} else {
cli_cleanup_files(spath);
}
}
if (command != NULL)