diff options
author | mrg <mrg@NetBSD.org> | 2006-05-18 18:42:59 +0000 |
---|---|---|
committer | mrg <mrg@NetBSD.org> | 2006-05-18 18:42:59 +0000 |
commit | 1d55feb5540573e2b97700e9bb927a9beef93d4b (patch) | |
tree | 20fc758bce4a749ecfec4b5adda5ef11c8996643 /adventure | |
parent | bed03016527f1e6cf4b292d2d03d52911c2cbc8c (diff) | |
download | bsdgames-darwin-1d55feb5540573e2b97700e9bb927a9beef93d4b.tar.gz bsdgames-darwin-1d55feb5540573e2b97700e9bb927a9beef93d4b.tar.zst bsdgames-darwin-1d55feb5540573e2b97700e9bb927a9beef93d4b.zip |
don't try to switch a char and have a case of EOF - use an int.
Diffstat (limited to 'adventure')
-rw-r--r-- | adventure/io.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/adventure/io.c b/adventure/io.c index 4ef081ef..05984817 100644 --- a/adventure/io.c +++ b/adventure/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.19 2006/03/21 17:14:15 christos Exp $ */ +/* $NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.19 2006/03/21 17:14:15 christos Exp $"); +__RCSID("$NetBSD: io.c,v 1.20 2006/05/18 18:42:59 mrg Exp $"); #endif #endif /* not lint */ @@ -60,16 +60,17 @@ getin(char **wrd1, char **wrd2) { char *s; static char wd1buf[MAXSTR], wd2buf[MAXSTR]; - int first, numch; + int first, numch, c; *wrd1 = wd1buf; /* return ptr to internal str */ *wrd2 = wd2buf; wd2buf[0] = 0; /* in case it isn't set here */ for (s = wd1buf, first = 1, numch = 0;;) { - if ((*s = getchar()) >= 'A' && *s <= 'Z') + c = getchar(); + if ((*s = (char)c) >= 'A' && *s <= 'Z') *s = *s - ('A' - 'a'); /* convert to upper case */ - switch (*s) { /* start reading from user */ + switch (c) { /* start reading from user */ case '\n': *s = 0; return; |