svn commit: r220699 - stable/7/tools/tools/iwi
Bruce Cran
brucec at FreeBSD.org
Sat Apr 16 10:22:07 UTC 2011
Author: brucec
Date: Sat Apr 16 10:22:06 2011
New Revision: 220699
URL: http://svn.freebsd.org/changeset/base/220699
Log:
MFC r219527:
Fix warnings and style(9) issues.
Set WARNS to 6.
Modified:
stable/7/tools/tools/iwi/Makefile
stable/7/tools/tools/iwi/iwistats.c
Directory Properties:
stable/7/tools/tools/iwi/ (props changed)
Modified: stable/7/tools/tools/iwi/Makefile
==============================================================================
--- stable/7/tools/tools/iwi/Makefile Sat Apr 16 10:20:45 2011 (r220698)
+++ stable/7/tools/tools/iwi/Makefile Sat Apr 16 10:22:06 2011 (r220699)
@@ -2,5 +2,6 @@
PROG= iwistats
NO_MAN=
+WARNS?=6
.include <bsd.prog.mk>
Modified: stable/7/tools/tools/iwi/iwistats.c
==============================================================================
--- stable/7/tools/tools/iwi/iwistats.c Sat Apr 16 10:20:45 2011 (r220698)
+++ stable/7/tools/tools/iwi/iwistats.c Sat Apr 16 10:22:06 2011 (r220699)
@@ -113,16 +113,17 @@ get_statistics(const char *iface)
static uint32_t stats[256];
const struct statistic *stat;
char oid[32];
- int ifaceno, len;
+ size_t len;
+ int ifaceno;
if (sscanf(iface, "iwi%u", &ifaceno) != 1)
errx(EX_DATAERR, "Invalid interface name '%s'", iface);
- len = sizeof stats;
- (void)snprintf(oid, sizeof oid, "dev.iwi.%u.stats", ifaceno);
+ len = sizeof(stats);
+ (void)snprintf(oid, sizeof(oid), "dev.iwi.%u.stats", ifaceno);
if (sysctlbyname(oid, stats, &len, NULL, 0) == -1)
err(EX_OSERR, "Can't retrieve statistics");
for (stat = tbl; stat->index != -1; stat++)
- (void)printf("%-60s[%lu]\n", stat->desc, stats[stat->index]);
+ (void)printf("%-60s[%u]\n", stat->desc, stats[stat->index]);
}
More information about the svn-src-stable-7
mailing list