fix file double close

This commit is contained in:
bumbread 2023-02-23 08:36:09 +11:00
parent 08c8efe47b
commit 47e185a1aa
1 changed files with 5 additions and 2 deletions

View File

@ -305,10 +305,13 @@ int fclose(FILE *stream) {
return EOF;
}
if(stream->temp) {
BOOL err = DeleteFileA(stream->temp_name);
BOOL ok = DeleteFileA(stream->temp_name);
free(stream->temp_name);
return err;
if(!ok) {
return EOF;
}
}
_file_untrack(stream);
return 0;
}