summaryrefslogtreecommitdiffstats
path: root/adventure/main.c
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-09-14 09:29:08 +0000
committerhubertf <hubertf@NetBSD.org>1998-09-14 09:29:08 +0000
commitab3c8a4ae26dfeb68ae67ed33f39558915aa0c69 (patch)
treeea4dbf5480a97439e70c036ff6cdeb6d5c773e6b /adventure/main.c
parentac89eb0e91b49c6c012b6ae0bf87686aea5ac5aa (diff)
downloadbsdgames-darwin-ab3c8a4ae26dfeb68ae67ed33f39558915aa0c69.tar.gz
bsdgames-darwin-ab3c8a4ae26dfeb68ae67ed33f39558915aa0c69.tar.zst
bsdgames-darwin-ab3c8a4ae26dfeb68ae67ed33f39558915aa0c69.zip
return error on errors (PR#6147 by Joseph Myers <jsm28@cam.ac.uk>)
Diffstat (limited to 'adventure/main.c')
-rw-r--r--adventure/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/adventure/main.c b/adventure/main.c
index cf5e268a..e3112c12 100644
--- a/adventure/main.c
+++ b/adventure/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.11 1998/09/13 15:21:37 hubertf Exp $ */
+/* $NetBSD: main.c,v 1.12 1998/09/14 09:29:08 hubertf Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -48,7 +48,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: main.c,v 1.11 1998/09/13 15:21:37 hubertf Exp $");
+__RCSID("$NetBSD: main.c,v 1.12 1998/09/14 09:29:08 hubertf Exp $");
#endif
#endif /* not lint */
@@ -90,10 +90,10 @@ main(argc, argv)
unlink(argv[1]); /* Don't re-use the save */
goto l8; /* Get where we're going */
case 1: /* Couldn't open it */
- exit(0); /* So give up */
+ errx(1,"can't open file"); /* So give up */
case 2: /* Oops -- file was altered */
rspeak(202); /* You dissolve */
- exit(0); /* File could be non-adventure */
+ exit(1); /* File could be non-adventure */
} /* So don't unlink it. */
}
startup(); /* prepare for a user */
@@ -277,8 +277,7 @@ l2630: i = vocab(wd1, -1, 0);
case 4:
goto l2010;
default:
- printf("Error 22\n");
- exit(0);
+ bug(22);
}
l8: