Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2017 12:02:31 -0700
From:      Michael McConville <mmcco@mykolab.com>
To:        freebsd-hackers@freebsd.org
Subject:   Possibly misordered arguments to memset(3)
Message-ID:  <20171213190230.gf5gax7vswakgrd4@t240>

next in thread | raw e-mail | index | archive | help
I can't claim to understand this function, but it seems unlikely that the
current ordering of the arguments was intentional.

Thanks for your time,
Michael McConville
University of Utah

diff --git a/tools/tools/netmap/pkt-gen.c b/tools/tools/netmap/pkt-gen.c
index 168e022cfba..6946ac3ba0e 100644
--- a/tools/tools/netmap/pkt-gen.c
+++ b/tools/tools/netmap/pkt-gen.c
@@ -612,7 +612,7 @@ dump_payload(const char *_p, int len, struct netmap_ring *ring, int cur)
 		ring->slot[cur].flags, len);
 	/* hexdump routine */
 	for (i = 0; i < len; ) {
-		memset(buf, sizeof(buf), ' ');
+		memset(buf, ' ', sizeof(buf));
 		sprintf(buf, "%5d: ", i);
 		i0 = i;
 		for (j=0; j < 16 && i < len; i++, j++)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171213190230.gf5gax7vswakgrd4>