diff options
author | hubertf <hubertf@NetBSD.org> | 1998-09-14 09:29:08 +0000 |
---|---|---|
committer | hubertf <hubertf@NetBSD.org> | 1998-09-14 09:29:08 +0000 |
commit | ab3c8a4ae26dfeb68ae67ed33f39558915aa0c69 (patch) | |
tree | ea4dbf5480a97439e70c036ff6cdeb6d5c773e6b /adventure/io.c | |
parent | ac89eb0e91b49c6c012b6ae0bf87686aea5ac5aa (diff) | |
download | bsdgames-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/io.c')
-rw-r--r-- | adventure/io.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/adventure/io.c b/adventure/io.c index 548339bf..97987009 100644 --- a/adventure/io.c +++ b/adventure/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.9 1998/09/13 15:24:09 hubertf Exp $ */ +/* $NetBSD: io.c,v 1.10 1998/09/14 09:29:08 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.9 1998/09/13 15:24:09 hubertf Exp $"); +__RCSID("$NetBSD: io.c,v 1.10 1998/09/14 09:29:08 hubertf Exp $"); #endif #endif /* not lint */ @@ -297,10 +297,8 @@ rdesc(sect) /* read description-format msgs */ ptext[oldloc].txtlen = maystart - seekstart; break; case 6:/* random messages */ - if (oldloc > RTXSIZ) { - printf("Too many random msgs\n"); - exit(0); - } + if (oldloc > RTXSIZ) + errx(1,"Too many random msgs"); rtext[oldloc].seekadr = seekhere; rtext[oldloc].txtlen = maystart - seekstart; break; @@ -310,16 +308,13 @@ rdesc(sect) /* read description-format msgs */ cval[clsses++] = oldloc; break; case 12: /* magic messages */ - if (oldloc > MAGSIZ) { - printf("Too many magic msgs\n"); - exit(0); - } + if (oldloc > MAGSIZ) + errx(1,"Too many magic msgs"); mtext[oldloc].seekadr = seekhere; mtext[oldloc].txtlen = maystart - seekstart; break; default: - printf("rdesc called with bad section\n"); - exit(0); + errx(1,"rdesc called with bad section"); } seekhere += maystart - seekstart; } |