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
This commit is contained in:
proski 2012-05-01 19:52:26 +00:00
parent 35db352fc7
commit f72edc7741
2 changed files with 6 additions and 6 deletions

View File

@ -284,7 +284,7 @@ main(int argc, char *argv[])
/* no args, just show global stats */ /* no args, just show global stats */
ifr.ifr_data = (caddr_t) &stats; ifr.ifr_data = (caddr_t) &stats;
if (ioctl(s, SIOCG80211STATS, &ifr) < 0) if (ioctl(s, SIOCG80211STATS, &ifr) < 0)
err(1, ifr.ifr_name); err(1, "%s", ifr.ifr_name);
printstats(stdout, &stats); printstats(stdout, &stats);
return 0; return 0;
} }

View File

@ -285,9 +285,9 @@ main(int argc, char *argv[])
if (line != 0) { if (line != 0) {
ifr.ifr_data = (caddr_t) &cur; ifr.ifr_data = (caddr_t) &cur;
if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) if (ioctl(s, SIOCGATHSTATS, &ifr) < 0)
err(1, ifr.ifr_name); err(1, "%s", ifr.ifr_name);
if (!getifstats(ifr.ifr_name, &icur, &ocur)) 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", printf("%8lu %8lu %7u %7u %7u %6u %6u %6u %7u %4u %3uM\n",
(icur - itot) - (icur - itot) -
(cur.ast_rx_mgt - total.ast_rx_mgt), (cur.ast_rx_mgt - total.ast_rx_mgt),
@ -307,9 +307,9 @@ main(int argc, char *argv[])
} else { } else {
ifr.ifr_data = (caddr_t) &total; ifr.ifr_data = (caddr_t) &total;
if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) if (ioctl(s, SIOCGATHSTATS, &ifr) < 0)
err(1, ifr.ifr_name); err(1, "%s", ifr.ifr_name);
if (!getifstats(ifr.ifr_name, &itot, &otot)) 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", printf("%8lu %8lu %7u %7u %7u %6u %6u %6u %7u %4u %3uM\n",
itot - total.ast_rx_mgt, itot - total.ast_rx_mgt,
otot, otot,
@ -344,7 +344,7 @@ main(int argc, char *argv[])
ifr.ifr_data = (caddr_t) &stats; ifr.ifr_data = (caddr_t) &stats;
if (ioctl(s, SIOCGATHSTATS, &ifr) < 0) if (ioctl(s, SIOCGATHSTATS, &ifr) < 0)
err(1, ifr.ifr_name); err(1, "%s", ifr.ifr_name);
printstats(stdout, &stats); printstats(stdout, &stats);
} }
return 0; return 0;