diff options
Diffstat (limited to 'games/adventure')
-rw-r--r-- | games/adventure/io.c | 6 | ||||
-rw-r--r-- | games/adventure/wizard.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/games/adventure/io.c b/games/adventure/io.c index de2a5781254..ad685424cda 100644 --- a/games/adventure/io.c +++ b/games/adventure/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.10 2001/08/06 22:59:05 pjanzen Exp $ */ +/* $OpenBSD: io.c,v 1.11 2002/02/18 06:38:42 deraadt Exp $ */ /* $NetBSD: io.c,v 1.3 1995/04/24 12:21:37 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: io.c,v 1.10 2001/08/06 22:59:05 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: io.c,v 1.11 2002/02/18 06:38:42 deraadt Exp $"; #endif #endif /* not lint */ @@ -161,7 +161,7 @@ yesm(x, y, z) /* confirm with mspeak */ int x, y, z; { int result; - char ch; + int ch; for (;;) { mspeak(x); /* tell him what we want */ diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index 91b7cd6fcd5..c24a0e758ba 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wizard.c,v 1.8 2001/03/22 22:31:47 pjanzen Exp $ */ +/* $OpenBSD: wizard.c,v 1.9 2002/02/18 06:38:43 deraadt Exp $ */ /* $NetBSD: wizard.c,v 1.3 1995/04/24 12:21:41 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93"; #else -static char rcsid[] = "$OpenBSD: wizard.c,v 1.8 2001/03/22 22:31:47 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: wizard.c,v 1.9 2002/02/18 06:38:43 deraadt Exp $"; #endif #endif /* not lint */ @@ -130,13 +130,16 @@ wizard() /* not as complex as advent/10 (for now) */ void ciao() { + int ch; char *c; char fname[MAXPATHLEN]; printf("What would you like to call the saved version?\n"); - for (c = fname; c - fname < MAXPATHLEN; c++) - if ((*c = getchar()) == '\n' || *c == EOF) + for (c = fname; c - fname < MAXPATHLEN; c++) { + *c = ch = getchar(); + if ((*c = getchar()) == '\n' || ch == EOF) break; + } if (c - fname == MAXPATHLEN) { c--; FLUSHLINE; |