summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/battlestar/com2.c4
-rw-r--r--games/hack/hack.end.c6
-rw-r--r--games/hunt/huntd/driver.c4
-rw-r--r--games/mille/move.c12
4 files changed, 13 insertions, 13 deletions
diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c
index 93685ca3f57..ea46a8821a1 100644
--- a/games/battlestar/com2.c
+++ b/games/battlestar/com2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com2.c,v 1.16 2009/10/27 23:59:23 deraadt Exp $ */
+/* $OpenBSD: com2.c,v 1.17 2009/12/10 23:53:03 beck Exp $ */
/* $NetBSD: com2.c,v 1.3 1995/03/21 15:06:55 cgd Exp $ */
/*
@@ -176,7 +176,7 @@ murder(void)
if (inc_wordnumber(words[wordnumber], "whom"))
return;
- for (n = 0; !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && TestBit(inven, n)) && n < NUMOFOBJECTS; n++)
+ for (n = 0; n < NUMOFOBJECTS && !((n == SWORD || n == KNIFE || n == TWO_HANDED || n == MACE || n == CLEAVER || n == BROAD || n == CHAIN || n == SHOVEL || n == HALBERD) && TestBit(inven, n)); n++)
;
if (n == NUMOFOBJECTS) {
if (TestBit(inven, LASER)) {
diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c
index 9d87b4d6f14..10a566384ee 100644
--- a/games/hack/hack.end.c
+++ b/games/hack/hack.end.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hack.end.c,v 1.10 2009/10/27 23:59:25 deraadt Exp $ */
+/* $OpenBSD: hack.end.c,v 1.11 2009/12/10 23:53:07 beck Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -348,7 +348,7 @@ topten()
tprev = 0;
/* rank0: -1 undefined, 0 not_on_list, n n_th on list */
for(rank = 1; ; ) {
- if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %[^,],%[^\n]",
+ if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %8[^,],%40[^\n]",
t1->date, &t1->uid,
&t1->level, &t1->maxlvl,
&t1->hp, &t1->maxhp, &t1->points,
@@ -667,7 +667,7 @@ prscore(int argc, char **argv)
t1 = tt_head = newttentry();
for(rank = 1; ; rank++) {
- if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %[^,],%[^\n]",
+ if(fscanf(rfile, "%6s %d %d %d %d %d %ld %c%c %8[^,],%40[^\n]",
t1->date, &t1->uid,
&t1->level, &t1->maxlvl,
&t1->hp, &t1->maxhp, &t1->points,
diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c
index 0ab3bbf3e06..056f1ddbf04 100644
--- a/games/hunt/huntd/driver.c
+++ b/games/hunt/huntd/driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: driver.c,v 1.18 2008/10/02 16:44:43 millert Exp $ */
+/* $OpenBSD: driver.c,v 1.19 2009/12/10 23:53:06 beck Exp $ */
/* $NetBSD: driver.c,v 1.5 1997/10/20 00:37:16 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -755,7 +755,7 @@ zap(pp, was_player)
break;
/* Pick the larger of the bomb or slime: */
if (btype >= 0 && stype >= 0) {
- if (shot_req[btype] > slime_req[btype])
+ if (shot_req[btype] > slime_req[stype])
btype = -1;
}
if (btype >= 0) {
diff --git a/games/mille/move.c b/games/mille/move.c
index 9e1f97af09a..9a406bb06be 100644
--- a/games/mille/move.c
+++ b/games/mille/move.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: move.c,v 1.11 2009/10/27 23:59:25 deraadt Exp $ */
+/* $OpenBSD: move.c,v 1.12 2009/12/10 23:53:05 beck Exp $ */
/* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */
/*
@@ -130,11 +130,11 @@ acc:
else
for (i = 1; i < HAND_SZ; i++)
if (pp->hand[i] == C_INIT) {
- for (j = 0; pp->hand[j] == C_INIT; j++)
- if (j >= HAND_SZ) {
- j = 0;
- break;
- }
+ for (j = 0; (j < HAND_SZ) &&
+ (pp->hand[j] == C_INIT); j++)
+ ;
+ if (j == HAND_SZ)
+ j = 0;
pp->hand[i] = pp->hand[j];
pp->hand[j] = C_INIT;
}