Source-Changes-HG archive

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

[src/trunk]: src/games/cribbage Don't use variables as format strings.



details:   https://anonhg.NetBSD.org/src/rev/683bd2946f1e
branches:  trunk
changeset: 765282:683bd2946f1e
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon May 23 22:48:52 2011 +0000

description:
Don't use variables as format strings.

diffstat:

 games/cribbage/io.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 05583a8feff5 -r 683bd2946f1e games/cribbage/io.c
--- a/games/cribbage/io.c       Mon May 23 22:47:22 2011 +0000
+++ b/games/cribbage/io.c       Mon May 23 22:48:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: io.c,v 1.25 2011/05/23 22:47:22 joerg Exp $    */
+/*     $NetBSD: io.c,v 1.26 2011/05/23 22:48:52 joerg Exp $    */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)io.c       8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: io.c,v 1.25 2011/05/23 22:47:22 joerg Exp $");
+__RCSID("$NetBSD: io.c,v 1.26 2011/05/23 22:48:52 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -106,13 +106,13 @@
        if (brfrank)
                addmsg("%1.1s", rankchar[c.rank]);
        else
-               addmsg(rankname[c.rank]);
+               addmsg("%s", rankname[c.rank]);
        if (mid != NULL)
-               addmsg(mid);
+               addmsg("%s", mid);
        if (brfsuit)
                addmsg("%1.1s", suitchar[c.suit]);
        else
-               addmsg(suitname[c.suit]);
+               addmsg("%s", suitname[c.suit]);
        return (TRUE);
 }
 
@@ -180,7 +180,7 @@
                exit(74);
        }
        for (;;) {
-               msg(prompt);
+               msg("%s", prompt);
                if (incard(&crd)) {     /* if card is full card */
                        if (!is_one(crd, hand, n))
                                msg("That's not in your hand");
@@ -330,7 +330,7 @@
        int sum;
 
        for (sum = 0;;) {
-               msg(prompt);
+               msg("%s", prompt);
                if (!(p = get_line()) || *p == '\0') {
                        msg(quiet ? "Not a number" :
                            "That doesn't look like a number");



Home | Main Index | Thread Index | Old Index