diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2006-03-27 00:10:16 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2006-03-27 00:10:16 +0000 |
commit | 1e83c82a3bf562241906e89f69222dfa40422206 (patch) | |
tree | 3cb64e8eb5d6a8755f5b2b2f0f18285a9094a131 /games/backgammon | |
parent | 8865bd2a63b0dd63bb6398ca8fef60e3f5669d34 (diff) |
assorted fixes mostly from coverity via netbsd via jasper adriaanse via tech
Diffstat (limited to 'games/backgammon')
-rw-r--r-- | games/backgammon/common_source/odds.c | 6 | ||||
-rw-r--r-- | games/backgammon/common_source/save.c | 5 | ||||
-rw-r--r-- | games/backgammon/common_source/table.c | 7 |
3 files changed, 9 insertions, 9 deletions
diff --git a/games/backgammon/common_source/odds.c b/games/backgammon/common_source/odds.c index 6583458d221..68cbb49fa75 100644 --- a/games/backgammon/common_source/odds.c +++ b/games/backgammon/common_source/odds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: odds.c,v 1.3 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: odds.c,v 1.4 2006/03/27 00:10:14 tedu Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,7 +33,7 @@ #if 0 static char sccsid[] = "@(#)odds.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: odds.c,v 1.3 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: odds.c,v 1.4 2006/03/27 00:10:14 tedu Exp $"; #endif #endif /* not lint */ @@ -98,7 +98,7 @@ canhit(i, c) if (board[j] * a > 0) { diff = abs(j - i); addon = place + ((board[j] * a > 2 || j == b) ? 5 : 0); - if ((j == b && menstuck == 1) && + if ((j == b && menstuck == 1) || (j != b && menstuck == 0)) for (k = 1; k < diff; k++) if (k < 7 && diff - k < 7 && diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index c638663c517..bf05e16b4af 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.8 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: save.c,v 1.9 2006/03/27 00:10:14 tedu Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,7 +33,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: save.c,v 1.8 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: save.c,v 1.9 2006/03/27 00:10:14 tedu Exp $"; #endif #endif /* not lint */ @@ -113,7 +113,6 @@ save(n) } } printw("%s%s.\n", cantuse, fname); - close(fdesc); cflag = 1; } write(fdesc, board, sizeof(board)); diff --git a/games/backgammon/common_source/table.c b/games/backgammon/common_source/table.c index 2889ddce890..5ecdac6708e 100644 --- a/games/backgammon/common_source/table.c +++ b/games/backgammon/common_source/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.6 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: table.c,v 1.7 2006/03/27 00:10:14 tedu Exp $ */ /* * Copyright (c) 1980, 1993 @@ -33,7 +33,7 @@ #if 0 static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: table.c,v 1.6 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: table.c,v 1.7 2006/03/27 00:10:14 tedu Exp $"; #endif #endif /* not lint */ @@ -253,6 +253,7 @@ rsetbrd() 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); } |