From 2e97bed1073ca965f36938e2ceb5fb26da06e3b1 Mon Sep 17 00:00:00 2001 From: hubertf Date: Mon, 24 Aug 1998 00:25:32 +0000 Subject: Untakable objects are marked with NULL pointers, not empty strings, resulting in core dumps. Fixed as per PR 6006 by Joseph Myers . --- battlestar/cypher.c | 12 ++++++------ 1 file 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(); } -- cgit v1.2.3