Skip to content

Commit

Permalink
fix exeflat not deleting temporary file
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann authored and PerditionC committed Dec 8, 2023
1 parent 95694f7 commit e4a62f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/exeflat.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,11 @@ int main(int argc, char **argv)
} else {
tmpexe = "tmp.sys";
}
rename(argv[2], tmpexe);
if (rename(argv[2], tmpexe))
{
printf("Can not rename %s to %s\n", argv[2], tmpexe);
exit(1);
}

len2 = strlen(tmpexe) + 1;
sz = len2;
Expand Down Expand Up @@ -615,6 +619,6 @@ int main(int argc, char **argv)

fclose(source);
remove("tmp.bin");

remove(tmpexe);
return 0;
}

0 comments on commit e4a62f2

Please sign in to comment.