summaryrefslogtreecommitdiffstats
path: root/battlestar/cypher.c
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-08-24 00:25:32 +0000
committerhubertf <hubertf@NetBSD.org>1998-08-24 00:25:32 +0000
commit2e97bed1073ca965f36938e2ceb5fb26da06e3b1 (patch)
tree2c2c6a8141424cf7f504c5ae678431f63b3bfbe6 /battlestar/cypher.c
parentc30f6208721caccaf5be67e01a0be829b6f8e5be (diff)
downloadbsdgames-darwin-2e97bed1073ca965f36938e2ceb5fb26da06e3b1.tar.gz
bsdgames-darwin-2e97bed1073ca965f36938e2ceb5fb26da06e3b1.tar.zst
bsdgames-darwin-2e97bed1073ca965f36938e2ceb5fb26da06e3b1.zip
Untakable objects are marked with NULL pointers, not empty strings,
resulting in core dumps. Fixed as per PR 6006 by Joseph Myers <jsm28@cam.ac.uk>.
Diffstat (limited to 'battlestar/cypher.c')
-rw-r--r--battlestar/cypher.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/battlestar/cypher.c b/battlestar/cypher.c
index 2dd965e6..d3d85904 100644
--- a/battlestar/cypher.c
+++ b/battlestar/cypher.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cypher.c,v 1.6 1997/10/11 02:07:11 lukem Exp $ */
+/* $NetBSD: cypher.c,v 1.7 1998/08/24 00:25:32 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: cypher.c,v 1.6 1997/10/11 02:07:11 lukem Exp $");
+__RCSID("$NetBSD: cypher.c,v 1.7 1998/08/24 00:25:32 hubertf Exp $");
#endif
#endif /* not lint */
@@ -103,7 +103,7 @@ cypher()
case SHOOT:
if (wordnumber < wordcount && wordvalue[wordnumber + 1] == EVERYTHING) {
for (n = 0; n < NUMOFOBJECTS; n++)
- if (testbit(location[position].objects, n) && *objsht[n]) {
+ if (testbit(location[position].objects, n) && objsht[n]) {
wordvalue[wordnumber + 1] = n;
wordnumber = shoot();
}
@@ -116,7 +116,7 @@ cypher()
case TAKE:
if (wordnumber < wordcount && wordvalue[wordnumber + 1] == EVERYTHING) {
for (n = 0; n < NUMOFOBJECTS; n++)
- if (testbit(location[position].objects, n) && *objsht[n]) {
+ if (testbit(location[position].objects, n) && objsht[n]) {
wordvalue[wordnumber + 1] = n;
wordnumber = take(location[position].objects);
}
@@ -146,7 +146,7 @@ cypher()
if (wordnumber < wordcount && wordvalue[wordnumber + 1] == EVERYTHING) {
for (n = 0; n < NUMOFOBJECTS; n++)
if (testbit(inven, n) ||
- (testbit(location[position].objects, n) && *objsht[n])) {
+ (testbit(location[position].objects, n) && objsht[n])) {
wordvalue[wordnumber + 1] = n;
wordnumber = throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown");
}
@@ -186,7 +186,7 @@ cypher()
if (wordnumber < wordcount && wordvalue[wordnumber + 1] == EVERYTHING) {
for (n = 0; n < NUMOFOBJECTS; n++)
- if (testbit(location[position].objects, n) && *objsht[n]) {
+ if (testbit(location[position].objects, n) && objsht[n]) {
wordvalue[wordnumber + 1] = n;
wordnumber = puton();
}