summaryrefslogtreecommitdiffstats
path: root/sail/pl_5.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-01-28 01:58:01 +0000
committerdholland <dholland@NetBSD.org>2008-01-28 01:58:01 +0000
commit928cdd4e3649aeb97d675a5babd680b668c9e24f (patch)
treea58fcaeda0d48d6931b4bc060443444aee2093ca /sail/pl_5.c
parent02b84b6eaa176512e869c83c44c5e07176b29785 (diff)
downloadbsdgames-darwin-928cdd4e3649aeb97d675a5babd680b668c9e24f.tar.gz
bsdgames-darwin-928cdd4e3649aeb97d675a5babd680b668c9e24f.tar.zst
bsdgames-darwin-928cdd4e3649aeb97d675a5babd680b668c9e24f.zip
Build with WARNS=4. Sort out the game's shadowing of its own variables,
which fixes at least one bug.
Diffstat (limited to 'sail/pl_5.c')
-rw-r--r--sail/pl_5.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sail/pl_5.c b/sail/pl_5.c
index d19fc407..9f22f92b 100644
--- a/sail/pl_5.c
+++ b/sail/pl_5.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pl_5.c,v 1.18 2006/03/18 01:43:52 abs Exp $ */
+/* $NetBSD: pl_5.c,v 1.19 2008/01/28 01:58:01 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_5.c,v 1.18 2006/03/18 01:43:52 abs Exp $");
+__RCSID("$NetBSD: pl_5.c,v 1.19 2008/01/28 01:58:01 dholland Exp $");
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ acceptmove(void)
char af;
int moved = 0;
int vma, dir;
- char prompt[60];
+ char promptstr[60];
char buf[60], last = '\0';
char *p;
@@ -70,8 +70,9 @@ acceptmove(void)
ta = maxturns(ms, &af);
ma = maxmove(ms, mf->dir, 0);
- sprintf(prompt, "move (%d,%c%d): ", ma, af ? '\'' : ' ', ta);
- sgetstr(prompt, buf, sizeof buf);
+ snprintf(promptstr, sizeof(promptstr),
+ "move (%d,%c%d): ", ma, af ? '\'' : ' ', ta);
+ sgetstr(promptstr, buf, sizeof buf);
dir = mf->dir;
vma = ma;
for (p = buf; *p; p++)