summaryrefslogtreecommitdiff
path: root/games/sail
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2006-03-27 00:10:16 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2006-03-27 00:10:16 +0000
commit1e83c82a3bf562241906e89f69222dfa40422206 (patch)
tree3cb64e8eb5d6a8755f5b2b2f0f18285a9094a131 /games/sail
parent8865bd2a63b0dd63bb6398ca8fef60e3f5669d34 (diff)
assorted fixes mostly from coverity via netbsd via jasper adriaanse via tech
Diffstat (limited to 'games/sail')
-rw-r--r--games/sail/dr_1.c6
-rw-r--r--games/sail/pl_5.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/games/sail/dr_1.c b/games/sail/dr_1.c
index 8d241aa57f5..107fc7130cc 100644
--- a/games/sail/dr_1.c
+++ b/games/sail/dr_1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dr_1.c,v 1.4 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: dr_1.c,v 1.5 2006/03/27 00:10:15 tedu Exp $ */
/* $NetBSD: dr_1.c,v 1.4 1995/04/24 12:25:10 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: dr_1.c,v 1.4 2003/06/03 03:01:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: dr_1.c,v 1.5 2006/03/27 00:10:15 tedu Exp $";
#endif
#endif /* not lint */
@@ -419,7 +419,7 @@ next()
bestship = s;
}
}
- if (best > 0.0) {
+ if (bestship) {
char *tp = getenv("WOTD");
const char *p;
if (tp == 0)
diff --git a/games/sail/pl_5.c b/games/sail/pl_5.c
index 61efa40d315..2fb27a9bbdd 100644
--- a/games/sail/pl_5.c
+++ b/games/sail/pl_5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pl_5.c,v 1.4 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: pl_5.c,v 1.5 2006/03/27 00:10:15 tedu Exp $ */
/* $NetBSD: pl_5.c,v 1.4 1995/04/24 12:25:21 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: pl_5.c,v 1.4 2003/06/03 03:01:41 millert Exp $";
+static char rcsid[] = "$OpenBSD: pl_5.c,v 1.5 2006/03/27 00:10:15 tedu Exp $";
#endif
#endif /* not lint */
@@ -214,7 +214,7 @@ parties(crew, to, isdefense, buf)
ptr = isdefense ? to->file->DBP : to->file->OBP;
for (j = 0; j < NBP && ptr[j].turnsent; j++)
;
- if (!ptr[j].turnsent && buf > '0') {
+ if (j < NBP && buf > '0') {
men = 0;
for (k = 0; k < 3 && buf > '0'; k++) {
men += crew[k]