summaryrefslogtreecommitdiffstats
path: root/games/backgammon
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-04-06 18:50:33 +0000
committerderaadt <deraadt@openbsd.org>2003-04-06 18:50:33 +0000
commit42ceebb3a4a2e2ff98883f49d4679469199da9d6 (patch)
treefa818afd86caf65af7822aacc437c10c5b9c68b8 /games/backgammon
parentuse strlcat (diff)
downloadwireguard-openbsd-42ceebb3a4a2e2ff98883f49d4679469199da9d6.tar.xz
wireguard-openbsd-42ceebb3a4a2e2ff98883f49d4679469199da9d6.zip
2451 lines of strdup/sprintf/strcpy whacking. mostly ok'd by pjanzen
already, but he may have later changes to make still.
Diffstat (limited to 'games/backgammon')
-rw-r--r--games/backgammon/common_source/board.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/games/backgammon/common_source/board.c b/games/backgammon/common_source/board.c
index fa5dfe7c3ca..4d299bfd238 100644
--- a/games/backgammon/common_source/board.c
+++ b/games/backgammon/common_source/board.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: board.c,v 1.5 2001/06/23 23:50:03 pjanzen Exp $ */
+/* $OpenBSD: board.c,v 1.6 2003/04/06 18:50:36 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: board.c,v 1.5 2001/06/23 23:50:03 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: board.c,v 1.6 2003/04/06 18:50:36 deraadt Exp $";
#endif
#endif /* not lint */
@@ -61,7 +61,7 @@ wrboard()
goto lastline;
addstr("_____________________________________________________\n");
addstr(bl);
- strcpy(ln, bl);
+ strlcpy(ln, bl, sizeof ln);
for (j = 1; j < 50; j += 4) {
k = j / 4 + (j > 24 ? 12 : 13);
ln[j + 1] = k % 10 + '0';
@@ -71,7 +71,7 @@ wrboard()
}
addstr(ln);
for (i = 0; i < 5; i++) {
- strcpy(ln, sv);
+ strlcpy(ln, sv, sizeof ln);
for (j = 1; j < 50; j += 4) {
k = j / 4 + (j > 24 ? 12 : 13);
wrbsub();
@@ -101,12 +101,12 @@ wrboard()
ln[l] = '\0';
addstr(ln);
}
- strcpy(ln, bl);
+ strlcpy(ln, bl, sizeof ln);
ln[25] = 'B';
ln[26] = 'A';
ln[27] = 'R';
addstr(ln);
- strcpy(ln, sv);
+ strlcpy(ln, sv, sizeof ln);
for (i = 4; i > -1; i--) {
for (j = 1; j < 50; j += 4) {
k = ((j > 24 ? 53 : 49) - j) / 4;
@@ -137,7 +137,7 @@ wrboard()
ln[l] = '\0';
addstr(ln);
}
- strcpy(ln, bl);
+ strlcpy(ln, bl, sizeof ln);
for (j = 1; j < 50; j += 4) {
k = ((j > 24 ? 53 : 49) - j) / 4;
ln[j + 1] = k % 10 + '0';