Date: Sat, 16 Apr 2011 10:20:45 +0000 (UTC) From: Bruce Cran <brucec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r220698 - stable/8/tools/tools/iwi Message-ID: <201104161020.p3GAKjrh001291@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brucec Date: Sat Apr 16 10:20:45 2011 New Revision: 220698 URL: http://svn.freebsd.org/changeset/base/220698 Log: MFC r219527: Fix warnings and style(9) issues. Set WARNS to 6. Modified: stable/8/tools/tools/iwi/Makefile stable/8/tools/tools/iwi/iwistats.c Directory Properties: stable/8/tools/tools/iwi/ (props changed) Modified: stable/8/tools/tools/iwi/Makefile ============================================================================== --- stable/8/tools/tools/iwi/Makefile Sat Apr 16 10:18:07 2011 (r220697) +++ stable/8/tools/tools/iwi/Makefile Sat Apr 16 10:20:45 2011 (r220698) @@ -2,5 +2,6 @@ PROG= iwistats NO_MAN= +WARNS?=6 .include <bsd.prog.mk> Modified: stable/8/tools/tools/iwi/iwistats.c ============================================================================== --- stable/8/tools/tools/iwi/iwistats.c Sat Apr 16 10:18:07 2011 (r220697) +++ stable/8/tools/tools/iwi/iwistats.c Sat Apr 16 10:20:45 2011 (r220698) @@ -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?201104161020.p3GAKjrh001291>