diff options
author | ahoka <ahoka@NetBSD.org> | 2011-12-01 07:05:52 +0000 |
---|---|---|
committer | ahoka <ahoka@NetBSD.org> | 2011-12-01 07:05:52 +0000 |
commit | 43eaede84e20b51cd83e5e7b2c731b2ba749a30a (patch) | |
tree | 3a81d6702620122874b40944e2aa11d248852e0f /monop/monop.c | |
parent | 65dc63694f4b73fa9ab999ec34c932de770f8457 (diff) | |
download | bsdgames-darwin-43eaede84e20b51cd83e5e7b2c731b2ba749a30a.tar.gz bsdgames-darwin-43eaede84e20b51cd83e5e7b2c731b2ba749a30a.tar.zst bsdgames-darwin-43eaede84e20b51cd83e5e7b2c731b2ba749a30a.zip |
handle EOF in input
Diffstat (limited to 'monop/monop.c')
-rw-r--r-- | monop/monop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/monop/monop.c b/monop/monop.c index 3a54fccd..1d140299 100644 --- a/monop/monop.c +++ b/monop/monop.c @@ -1,4 +1,4 @@ -/* $NetBSD: monop.c,v 1.25 2009/08/12 08:10:49 dholland Exp $ */ +/* $NetBSD: monop.c,v 1.26 2011/12/01 07:05:52 ahoka Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: monop.c,v 1.25 2009/08/12 08:10:49 dholland Exp $"); +__RCSID("$NetBSD: monop.c,v 1.26 2011/12/01 07:05:52 ahoka Exp $"); #endif #endif /* not lint */ @@ -286,8 +286,7 @@ blew_it: printf("Player %d's name: ", i + 1); fgets(buf, sizeof(buf), stdin); if (feof(stdin)) { - printf("End of file on stdin\n"); - exit(0); + quit(); } buf[strcspn(buf, "\n")] = '\0'; } while (strlen(buf) == 0); |