summaryrefslogtreecommitdiff
path: root/games/backgammon
diff options
context:
space:
mode:
Diffstat (limited to 'games/backgammon')
-rw-r--r--games/backgammon/common_source/odds.c6
-rw-r--r--games/backgammon/common_source/save.c5
-rw-r--r--games/backgammon/common_source/table.c7
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);
}