Date: Fri, 11 Mar 2011 19:32:15 +0000 (UTC) From: Bruce Cran <brucec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219527 - head/tools/tools/iwi Message-ID: <201103111932.p2BJWFr8091163@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brucec Date: Fri Mar 11 19:32:15 2011 New Revision: 219527 URL: http://svn.freebsd.org/changeset/base/219527 Log: Fix warnings and style(9) issues. Set WARNS to 6. Modified: head/tools/tools/iwi/Makefile head/tools/tools/iwi/iwistats.c Modified: head/tools/tools/iwi/Makefile ============================================================================== --- head/tools/tools/iwi/Makefile Fri Mar 11 19:27:31 2011 (r219526) +++ head/tools/tools/iwi/Makefile Fri Mar 11 19:32:15 2011 (r219527) @@ -2,5 +2,6 @@ PROG= iwistats NO_MAN= +WARNS?=6 .include <bsd.prog.mk> Modified: head/tools/tools/iwi/iwistats.c ============================================================================== --- head/tools/tools/iwi/iwistats.c Fri Mar 11 19:27:31 2011 (r219526) +++ head/tools/tools/iwi/iwistats.c Fri Mar 11 19:32:15 2011 (r219527) @@ -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]); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103111932.p2BJWFr8091163>