diff options
author | christos <christos@NetBSD.org> | 2006-03-18 23:23:33 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2006-03-18 23:23:33 +0000 |
commit | 8da61ac64118dfad78c5abd84051881c169901d5 (patch) | |
tree | c81c7c13e1db2398da3a7f790f413597a53e9fab | |
parent | 6a78126eecd1f3e22dcfbc295790b7699d895b46 (diff) | |
download | bsdgames-darwin-8da61ac64118dfad78c5abd84051881c169901d5.tar.gz bsdgames-darwin-8da61ac64118dfad78c5abd84051881c169901d5.tar.zst bsdgames-darwin-8da61ac64118dfad78c5abd84051881c169901d5.zip |
Coverity CID 1294: Avoid negative variable used as index.
-rw-r--r-- | backgammon/common_source/table.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/backgammon/common_source/table.c b/backgammon/common_source/table.c index 280fe87c..1b817dca 100644 --- a/backgammon/common_source/table.c +++ b/backgammon/common_source/table.c @@ -1,4 +1,4 @@ -/* $NetBSD: table.c,v 1.8 2005/07/01 01:12:39 jmc Exp $ */ +/* $NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: table.c,v 1.8 2005/07/01 01:12:39 jmc Exp $"); +__RCSID("$NetBSD: table.c,v 1.9 2006/03/18 23:23:33 christos Exp $"); #endif #endif /* not lint */ @@ -298,6 +298,7 @@ rsetbrd(void) for (i = 0; i < 4; i++) p[i] = g[i] = -1; for (j = 0; j < ncin; j++) - n = dotable(cin[j], n); + if ((n = dotable(cin[j], n)) < 0) + return n; return (n); } |