summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-13 17:15:42 +0000
committerjsm <jsm@NetBSD.org>1999-09-13 17:15:42 +0000
commitcfadcf734bf3b4a80ca74925211aed5e9c9563f7 (patch)
tree2919a8cc66a9870407f53ad21298d3a6d5d86bae
parent01389e73932da5ab0c565531b778ca875a9b7c31 (diff)
downloadbsdgames-darwin-cfadcf734bf3b4a80ca74925211aed5e9c9563f7.tar.gz
bsdgames-darwin-cfadcf734bf3b4a80ca74925211aed5e9c9563f7.zip
A couple more checks for file descriptor < 3 missed earlier.
-rw-r--r--battlestar/com6.c6
-rw-r--r--phantasia/main.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/battlestar/com6.c b/battlestar/com6.c
index 87a0935b..63b871b3 100644
--- a/battlestar/com6.c
+++ b/battlestar/com6.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com6.c,v 1.12 1999/09/08 21:45:25 jsm Exp $ */
+/* $NetBSD: com6.c,v 1.13 1999/09/13 17:15:42 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com6.c,v 1.12 1999/09/08 21:45:25 jsm Exp $");
+__RCSID("$NetBSD: com6.c,v 1.13 1999/09/13 17:15:42 jsm Exp $");
#endif
#endif /* not lint */
@@ -113,6 +113,8 @@ open_score_file()
score_fp = fopen(_PATH_SCORE, "a");
if (score_fp == NULL)
warn("open %s for append", _PATH_SCORE);
+ if (score_fp != NULL && fileno(score_fp) < 3)
+ exit(1);
}
void
diff --git a/phantasia/main.c b/phantasia/main.c
index 324c634e..034a2c49 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 1999/09/08 21:57:19 jsm Exp $ */
+/* $NetBSD: main.c,v 1.9 1999/09/13 17:15:43 jsm Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -287,6 +287,8 @@ initialstate()
if ((Playersfp = fopen(_PATH_PEOPLE, "r+")) == NULL)
error(_PATH_PEOPLE);
/* NOTREACHED */
+ if (fileno(Playersfp) < 3)
+ exit(1);
if ((Monstfp = fopen(_PATH_MONST, "r+")) == NULL)
error(_PATH_MONST);