Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/gomoku avoid non-literal format strings.



details:   https://anonhg.NetBSD.org/src/rev/c1af080ca112
branches:  trunk
changeset: 768413:c1af080ca112
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 16 11:10:54 2011 +0000

description:
avoid non-literal format strings.

diffstat:

 games/gomoku/main.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 4a8c2495c9a7 -r c1af080ca112 games/gomoku/main.c
--- a/games/gomoku/main.c       Tue Aug 16 11:06:34 2011 +0000
+++ b/games/gomoku/main.c       Tue Aug 16 11:10:54 2011 +0000
@@ -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 @@
 #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 @@
        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 @@
                        break;
                }
                if (interactive) {
-                       misclog(fmt[color], movenum, stoc(curmove));
+                       misclog("%3d%s%-6s", movenum, color ? "        " : " ",
+                           stoc(curmove));
                }
                if ((i = makemove(color, curmove)) != MOVEOK)
                        break;



Home | Main Index | Thread Index | Old Index