Avoid fclose(NULL).

Submitted by:	 OpenBSD (Theo de Raadt)
This commit is contained in:
Warner Losh 1998-01-07 00:12:04 +00:00
parent 545b0f4db7
commit 2959539268
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32298

View file

@ -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);