summaryrefslogtreecommitdiff
path: root/games/adventure/wizard.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-01-11 10:01:30 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-01-11 10:01:30 +0000
commit9b974fa6f1980e267a542c66f0404c67f2ef7b8b (patch)
tree4534ce502f59aff878f32953beed015126d3fa43 /games/adventure/wizard.c
parent4f48a3506fa1ed0edff5e433c05fd152bbc7e106 (diff)
Fix PR#2 in a simplistic way. Handle EOF on all getchar()s
Diffstat (limited to 'games/adventure/wizard.c')
-rw-r--r--games/adventure/wizard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c
index 2ff3f5f798b..4722391ebe8 100644
--- a/games/adventure/wizard.c
+++ b/games/adventure/wizard.c
@@ -120,7 +120,7 @@ char *cmdfile;
printf("What would you like to call the saved version?\n");
for (c=fname;; c++)
- if ((*c=getchar())=='\n') break;
+ if ((*c=getchar())=='\n' || *c == EOF) break;
*c=0;
if (save(fname) != 0) return; /* Save failed */
printf("To resume, say \"adventure %s\".\n", fname);