summaryrefslogtreecommitdiffstats
path: root/gomoku
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2011-08-16 11:10:54 +0000
committerchristos <christos@NetBSD.org>2011-08-16 11:10:54 +0000
commitea4e3d5fd9e93df96c4ab1c9cc6090610dd73bec (patch)
treebe520b0d8c4c84af733a5efc7e0cf2cd7632875b /gomoku
parent83998e7451d8a3752115a57b4ad851f42ac51f4f (diff)
downloadbsdgames-darwin-ea4e3d5fd9e93df96c4ab1c9cc6090610dd73bec.tar.gz
bsdgames-darwin-ea4e3d5fd9e93df96c4ab1c9cc6090610dd73bec.tar.zst
bsdgames-darwin-ea4e3d5fd9e93df96c4ab1c9cc6090610dd73bec.zip
avoid non-literal format strings.
Diffstat (limited to 'gomoku')
-rw-r--r--gomoku/main.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gomoku/main.c b/gomoku/main.c
index 4d5cf2dd..c0b1d5bc 100644
--- a/gomoku/main.c
+++ b/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.25 2010/03/29 05:16:08 dholland Exp $ */
+/* $NetBSD: main.c,v 1.26 2011/08/16 11:10:54 christos Exp $ */
/*
* Copyright (c) 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: main.c,v 1.25 2010/03/29 05:16:08 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.26 2011/08/16 11:10:54 christos Exp $");
#endif
#endif /* not lint */
@@ -94,10 +94,6 @@ main(int argc, char **argv)
char *tmp;
int color, curmove, i, ch;
int input[2];
- static const char *const fmt[2] = {
- "%3d %-6s",
- "%3d %-6s"
- };
/* Revoke setgid privileges */
setgid(getgid());
@@ -295,7 +291,8 @@ again:
break;
}
if (interactive) {
- misclog(fmt[color], movenum, stoc(curmove));
+ misclog("%3d%s%-6s", movenum, color ? " " : " ",
+ stoc(curmove));
}
if ((i = makemove(color, curmove)) != MOVEOK)
break;