From d3cf963e8bbba50b97f2730e0ba72dc51d93b8fb Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Thu, 10 Dec 2009 23:53:08 +0000 Subject: fix potential bugs spotted by parfait ok millert@ pjanzen@ --- games/mille/move.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'games/mille/move.c') 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; } -- cgit v1.2.3