Fix warnings and style(9) issues.

Set WARNS to 6.
This commit is contained in:
Rebecca Cran 2011-03-11 19:32:15 +00:00
parent 136882cf92
commit 71c8cbe3ef
2 changed files with 6 additions and 4 deletions

View File

@ -2,5 +2,6 @@
PROG= iwistats
NO_MAN=
WARNS?=6
.include <bsd.prog.mk>

View File

@ -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]);
}