summaryrefslogtreecommitdiff
path: root/games/atc
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>2000-07-23 22:23:43 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>2000-07-23 22:23:43 +0000
commit722786328ebb9bc3a9908e1199f5820495967c9e (patch)
tree8b980bfd8764be70c0a9ac4a874808ee11f9993f /games/atc
parentc0c45ffbae560ab416f07c82adf9390466da1bd2 (diff)
Handle EOF on stdin.
Diffstat (limited to 'games/atc')
-rw-r--r--games/atc/graphics.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/games/atc/graphics.c b/games/atc/graphics.c
index 8d7d016a1e3..ccb7c60fc42 100644
--- a/games/atc/graphics.c
+++ b/games/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $ */
+/* $OpenBSD: graphics.c,v 1.5 2000/07/23 22:23:37 pjanzen Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: graphics.c,v 1.5 2000/07/23 22:23:37 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -70,12 +70,13 @@ WINDOW *radar, *cleanradar, *credit, *input, *planes;
int
getAChar()
{
+ int c;
#ifdef BSD
- return (getchar());
+ if ((c = getchar()) == EOF && feof(stdin))
+ quit(0);
+ return (c);
#endif
#ifdef SYSV
- int c;
-
while ((c = getchar()) == -1 && errno == EINTR) ;
return(c);
#endif