From 71c8cbe3ef0a4e0bb5debdfd06bdb879ef777560 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Fri, 11 Mar 2011 19:32:15 +0000 Subject: [PATCH] Fix warnings and style(9) issues. Set WARNS to 6. --- tools/tools/iwi/Makefile | 1 + tools/tools/iwi/iwistats.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/tools/iwi/Makefile b/tools/tools/iwi/Makefile index 2bfaac62e44..9ad0681084e 100644 --- a/tools/tools/iwi/Makefile +++ b/tools/tools/iwi/Makefile @@ -2,5 +2,6 @@ PROG= iwistats NO_MAN= +WARNS?=6 .include diff --git a/tools/tools/iwi/iwistats.c b/tools/tools/iwi/iwistats.c index 7e6905493a6..1034dac7701 100644 --- a/tools/tools/iwi/iwistats.c +++ b/tools/tools/iwi/iwistats.c @@ -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]); }