summaryrefslogtreecommitdiffstats
path: root/adventure
diff options
context:
space:
mode:
authorrtr <rtr@NetBSD.org>2006-03-18 05:16:46 +0000
committerrtr <rtr@NetBSD.org>2006-03-18 05:16:46 +0000
commita26dfb5accabe938438abf0791f2a48ebbf478dc (patch)
tree3011727fa350c01915b71f96548c6ecab8d70f10 /adventure
parentcd327188bd11497debe9746d2191418a9f6a983f (diff)
downloadbsdgames-darwin-a26dfb5accabe938438abf0791f2a48ebbf478dc.tar.gz
bsdgames-darwin-a26dfb5accabe938438abf0791f2a48ebbf478dc.tar.zst
bsdgames-darwin-a26dfb5accabe938438abf0791f2a48ebbf478dc.zip
don't access out of bounds element of static alloc array.
found by Coverity, CID 1519 / Run 5 XXX possible that intention was to start with i = 0.
Diffstat (limited to 'adventure')
-rw-r--r--adventure/init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/adventure/init.c b/adventure/init.c
index eb930181..51877047 100644
--- a/adventure/init.c
+++ b/adventure/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $ */
+/* $NetBSD: init.c,v 1.16 2006/03/18 05:16:46 rtr Exp $ */
/*-
* Copyright (c) 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93";
#else
-__RCSID("$NetBSD: init.c,v 1.15 2005/07/01 00:03:36 jmc Exp $");
+__RCSID("$NetBSD: init.c,v 1.16 2006/03/18 05:16:46 rtr Exp $");
#endif
#endif /* not lint */
@@ -154,7 +154,7 @@ linkdata(void)
int i, j;
/* array linkages */
- for (i = 1; i <= LOCSIZ; i++)
+ for (i = 1; i < LOCSIZ; i++)
if (ltext[i].seekadr != 0 && travel[i] != 0)
if ((travel[i]->tverb) == 1)
cond[i] = 2;