summaryrefslogtreecommitdiffstats
path: root/games/battlestar/init.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-12-03 02:27:40 +0000
committerache <ache@FreeBSD.org>1994-12-03 02:27:40 +0000
commit53a929e65ca35fc4d62ba126188e4b830f5abfeb (patch)
tree58797cb2a2671308458f4656bdf168a766b4533c /games/battlestar/init.c
parent124986ecac5684e7c0d14b6cbe47cbfccd2f27c9 (diff)
downloadFreeBSD-src-53a929e65ca35fc4d62ba126188e4b830f5abfeb.zip
FreeBSD-src-53a929e65ca35fc4d62ba126188e4b830f5abfeb.tar.gz
Prevent core dump for root
Obtained from: partially from 1.1.5.1
Diffstat (limited to 'games/battlestar/init.c')
-rw-r--r--games/battlestar/init.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/games/battlestar/init.c b/games/battlestar/init.c
index 0b67b538..d0359de 100644
--- a/games/battlestar/init.c
+++ b/games/battlestar/init.c
@@ -50,10 +50,11 @@ initialize(startup)
puts("Admiral D.W. Riggle\n");
srand(getpid());
getutmp(uname);
+ if (startup)
+ location = dayfile;
wiz = wizard(uname);
wordinit();
if (startup) {
- location = dayfile;
direction = NORTH;
time = 0;
snooze = CYCLE * 1.5;
@@ -117,13 +118,15 @@ checkout(uname)
if (strcmp(*ptr, uname) == 0) {
printf("You are the Poor anti-wizard %s. Good Luck!\n",
uname);
- CUMBER = 3;
- WEIGHT = 9; /* that'll get him! */
- clock = 10;
- setbit(location[7].objects, WOODSMAN); /* viper room */
- setbit(location[20].objects, WOODSMAN); /* laser " */
- setbit(location[13].objects, DARK); /* amulet " */
- setbit(location[8].objects, ELF); /* closet */
+ if (location != NULL) {
+ CUMBER = 3;
+ WEIGHT = 9; /* that'll get him! */
+ clock = 10;
+ setbit(location[7].objects, WOODSMAN); /* viper room */
+ setbit(location[20].objects, WOODSMAN); /* laser " */
+ setbit(location[13].objects, DARK); /* amulet " */
+ setbit(location[8].objects, ELF); /* closet */
+ }
return 0; /* anything else, Chris? */
}
return 0;
OpenPOWER on IntegriCloud