summaryrefslogtreecommitdiff
path: root/games/phantasia/main.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-12-08 03:53:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-12-08 03:53:46 +0000
commitb68de49020ed231adc0661c582e046f8ce578c8d (patch)
tree3bf2d89a53364e28db2ee1230f44354853243326 /games/phantasia/main.c
parent0cb422baf2149443be8b899b8132c3aa099d01de (diff)
avoid fclose(NULL)
Diffstat (limited to 'games/phantasia/main.c')
-rw-r--r--games/phantasia/main.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/games/phantasia/main.c b/games/phantasia/main.c
index 3ad49dfeaa0..01949a95592 100644
--- a/games/phantasia/main.c
+++ b/games/phantasia/main.c
@@ -1279,10 +1279,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);