From d67c790d710721df7373e3c4de8be099ac96efbf Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Sat, 19 May 2018 20:57:22 +0000 Subject: [PATCH] mtest: build with WARNS=3 --- usr.sbin/mtest/Makefile | 2 +- usr.sbin/mtest/mtest.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mtest/Makefile b/usr.sbin/mtest/Makefile index 22c417c8141f..8afee2a87435 100644 --- a/usr.sbin/mtest/Makefile +++ b/usr.sbin/mtest/Makefile @@ -6,7 +6,7 @@ PROG= mtest MAN= mtest.8 BINMODE= 555 -WARNS?= 2 +WARNS?= 3 # XXX This assumes INET support in the base system. CFLAGS+=-DINET diff --git a/usr.sbin/mtest/mtest.c b/usr.sbin/mtest/mtest.c index d7190ee1f00e..f50c1a631a0a 100644 --- a/usr.sbin/mtest/mtest.c +++ b/usr.sbin/mtest/mtest.c @@ -388,6 +388,7 @@ process_cmd(char *cmd, int s, int s6, FILE *fp __unused) void *optval; uint32_t fmode, ifindex; socklen_t optlen; + size_t j; int af, error, f, flags, i, level, n, optname; af = AF_UNSPEC; @@ -736,8 +737,8 @@ process_cmd(char *cmd, int s, int s6, FILE *fp __unused) nsrc = MIN(nreqsrc, nsrc); fprintf(stderr, "hexdump of sources:\n"); uint8_t *bp = (uint8_t *)&sources[0]; - for (i = 0; i < (nsrc * sizeof(sources[0])); i++) { - fprintf(stderr, "%02x", bp[i]); + for (j = 0; j < (nsrc * sizeof(sources[0])); j++) { + fprintf(stderr, "%02x", bp[j]); } fprintf(stderr, "\nend hexdump\n");