diff options
author | dholland <dholland@NetBSD.org> | 2009-05-24 23:20:22 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-05-24 23:20:22 +0000 |
commit | 478be95d8d1ddb2e9cb1831f0115097af1e41bc4 (patch) | |
tree | 81172dfe5cc4fc359e2a3a3e251e366c5c2d1706 /trek/torped.c | |
parent | 5a874af0513d6e4a0b2b796da83651a4c2351310 (diff) | |
download | bsdgames-darwin-478be95d8d1ddb2e9cb1831f0115097af1e41bc4.tar.gz bsdgames-darwin-478be95d8d1ddb2e9cb1831f0115097af1e41bc4.tar.zst bsdgames-darwin-478be95d8d1ddb2e9cb1831f0115097af1e41bc4.zip |
Abolish cgetc(). It contained one line of code, which was wrong.
Call getchar() directly, and handle EOF properly instead of looping
(in some cases) or pretending that EOF is 0 (which it isn't).
Diffstat (limited to 'trek/torped.c')
-rw-r--r-- | trek/torped.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/trek/torped.c b/trek/torped.c index 388f69e1..24f3de4a 100644 --- a/trek/torped.c +++ b/trek/torped.c @@ -1,4 +1,4 @@ -/* $NetBSD: torped.c,v 1.13 2009/05/24 22:55:03 dholland Exp $ */ +/* $NetBSD: torped.c,v 1.14 2009/05/24 23:20:22 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)torped.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: torped.c,v 1.13 2009/05/24 22:55:03 dholland Exp $"); +__RCSID("$NetBSD: torped.c,v 1.14 2009/05/24 23:20:22 dholland Exp $"); #endif #endif /* not lint */ @@ -104,7 +104,7 @@ torped(int v __unused) } else { /* see if the user wants one */ if (!testnl()) { - k = ungetc(cgetc(0), stdin); + k = ungetc(getchar(), stdin); if (k >= '0' && k <= '9') burst = 1; } |