mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Avoid fclose(NULL).
Submitted by: OpenBSD (Theo de Raadt)
This commit is contained in:
parent
545b0f4db7
commit
2959539268
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32298
1 changed files with 16 additions and 4 deletions
|
@ -1277,10 +1277,22 @@ bool doexit;
|
|||
endwin();
|
||||
}
|
||||
|
||||
fclose(Playersfp);
|
||||
fclose(Monstfp);
|
||||
fclose(Messagefp);
|
||||
fclose(Energyvoidfp);
|
||||
if (Playersfp) {
|
||||
fclose(Playersfp);
|
||||
Playersfp = NULL;
|
||||
}
|
||||
if (Monstfp) {
|
||||
fclose(Monstfp);
|
||||
Monstfp = NULL;
|
||||
}
|
||||
if (Messagefp) {
|
||||
fclose(Messagefp);
|
||||
Messagefp = NULL;
|
||||
}
|
||||
if (Energyvoidfp) {
|
||||
fclose(Energyvoidfp);
|
||||
Energyvoidfp = NULL;
|
||||
}
|
||||
|
||||
if (doexit)
|
||||
exit(0);
|
||||
|
|
Loading…
Reference in a new issue