summaryrefslogtreecommitdiffstats
path: root/games/battlestar/com4.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1997-02-20 03:04:54 +0000
committereivind <eivind@FreeBSD.org>1997-02-20 03:04:54 +0000
commit27eb6d09a03b6d51d025fafa9e46e0f64544d722 (patch)
treec09c18b60a67afd2e34d5a6138c86fe56288b8e3 /games/battlestar/com4.c
parent1a5d9e17d08eb1b79c5918e8596ba8f18ea36461 (diff)
downloadFreeBSD-src-27eb6d09a03b6d51d025fafa9e46e0f64544d722.zip
FreeBSD-src-27eb6d09a03b6d51d025fafa9e46e0f64544d722.tar.gz
Remove buffer overflow and tempfile race, remove <sys/time.h> hack (and
need for it), change definition of setbit() macro and friends to be compatible with <sys/param.h>. The bugs were discovered and fixed as a result of the FreeBSD code audit. Submitted by: Aaron Bornstein <aaronb@j51.com>, Mark Huizer <xaa@stack.nl>
Diffstat (limited to 'games/battlestar/com4.c')
-rw-r--r--games/battlestar/com4.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c
index fe1d96b..eac4cf9 100644
--- a/games/battlestar/com4.c
+++ b/games/battlestar/com4.c
@@ -61,7 +61,7 @@ unsigned int from[];
setbit(inven,value);
carrying += objwt[value];
encumber += objcumber[value];
- time++;
+ gtime++;
if (testbit(from,value))
printf("Taken.\n");
else
@@ -165,7 +165,7 @@ unsigned int from[];
puts("ties it at the waist. Around her neck hangs a golden amulet.");
puts("She bids you to follow her.");
pleasure++;
- followgod = time;
+ followgod = gtime;
clearbit(location[position].objects,BATHGOD);
} else if (!testbit(location[position].objects,BATHGOD))
puts("You're in no position to take her.");
@@ -285,7 +285,7 @@ char *name;
setbit(location[position].objects,value);
else
tempwiz = 0;
- time++;
+ gtime++;
if (*name == 'K')
puts("Drop kicked.");
else
@@ -354,16 +354,16 @@ eat()
case MANGO:
printf("%s:\n",objsht[value]);
- if (testbit(inven,value) && time > ate - CYCLE && testbit(inven,KNIFE)){
+ if (testbit(inven,value) && gtime > ate - CYCLE && testbit(inven,KNIFE)){
clearbit(inven,value);
carrying -= objwt[value];
encumber -= objcumber[value];
- ate = max(time,ate) + CYCLE/3;
+ ate = max(gtime,ate) + CYCLE/3;
snooze += CYCLE/10;
- time++;
+ gtime++;
puts("Eaten. You can explore a little longer now.");
}
- else if (time < ate - CYCLE)
+ else if (gtime < ate - CYCLE)
puts("You're stuffed.");
else if (!testbit(inven,KNIFE))
puts("You need a knife.");
OpenPOWER on IntegriCloud