Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/wlanctl avoid non-literal format strings



details:   https://anonhg.NetBSD.org/src/rev/dbdde57c7cc4
branches:  trunk
changeset: 768402:dbdde57c7cc4
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Aug 16 08:33:46 2011 +0000

description:
avoid non-literal format strings

diffstat:

 usr.sbin/wlanctl/wlanctl.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r fbb148346f4e -r dbdde57c7cc4 usr.sbin/wlanctl/wlanctl.c
--- a/usr.sbin/wlanctl/wlanctl.c        Tue Aug 16 08:29:15 2011 +0000
+++ b/usr.sbin/wlanctl/wlanctl.c        Tue Aug 16 08:33:46 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wlanctl.c,v 1.11 2009/04/19 01:53:17 lukem Exp $ */
+/* $NetBSD: wlanctl.c,v 1.12 2011/08/16 08:33:46 christos Exp $ */
 /*-
  * Copyright (c) 2005 David Young.  All rights reserved.
  *
@@ -75,7 +75,7 @@
 print_rateset(struct ieee80211_rateset *rs, int txrate)
 {
        int i, rate;
-       const char *fmt, *basic;
+       const char *basic;
 
        printf("\trates");
 
@@ -85,12 +85,11 @@
                        basic = "*";
                else
                        basic = "";
+               rate = 5 * (rs->rs_rates[i] & IEEE80211_RATE_VAL);
                if (i == txrate)
-                       fmt = " [%s%d.%d]";
+                       printf(" [%s%d.%d]", basic, rate / 10, rate % 10);
                else
-                       fmt = " %s%d.%d";
-               rate = 5 * (rs->rs_rates[i] & IEEE80211_RATE_VAL);
-               printf(fmt, basic, rate / 10, rate % 10);
+                       printf(" %s%d.%d", basic, rate / 10, rate % 10);
        }
        printf("\n");
 }



Home | Main Index | Thread Index | Old Index