From f72edc774135c4f316b0aedd1a1b9a1162ec362a Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 1 May 2012 19:52:26 +0000 Subject: [PATCH] Use "%s" in err() calls to fix a warning on Ubuntu 10.04 err() would be confused if the interface name has formatting characters. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4179 0192ed92-7a03-0410-a25b-9323aeb14dbd --- tools/80211stats.c | 2 +- tools/athstats.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/80211stats.c b/tools/80211stats.c index 67d3e0a..68f1b27 100644 --- a/tools/80211stats.c +++ b/tools/80211stats.c @@ -284,7 +284,7 @@ main(int argc, char *argv[]) /* no args, just show global stats */ ifr.ifr_data = (caddr_t) &stats; if (ioctl(s, SIOCG80211STATS, &ifr) < 0) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); printstats(stdout, &stats); return 0; } diff --git a/tools/athstats.c b/tools/athstats.c index 2d3c887..c006a31 100644 --- a/tools/athstats.c +++ b/tools/athstats.c @@ -285,9 +285,9 @@ main(int argc, char *argv[]) if (line != 0) { ifr.ifr_data = (caddr_t) &cur; if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); if (!getifstats(ifr.ifr_name, &icur, &ocur)) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); printf("%8lu %8lu %7u %7u %7u %6u %6u %6u %7u %4u %3uM\n", (icur - itot) - (cur.ast_rx_mgt - total.ast_rx_mgt), @@ -307,9 +307,9 @@ main(int argc, char *argv[]) } else { ifr.ifr_data = (caddr_t) &total; if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); if (!getifstats(ifr.ifr_name, &itot, &otot)) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); printf("%8lu %8lu %7u %7u %7u %6u %6u %6u %7u %4u %3uM\n", itot - total.ast_rx_mgt, otot, @@ -344,7 +344,7 @@ main(int argc, char *argv[]) ifr.ifr_data = (caddr_t) &stats; if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) - err(1, ifr.ifr_name); + err(1, "%s", ifr.ifr_name); printstats(stdout, &stats); } return 0;