Possibly misordered arguments to memset(3)

Michael McConville mmcco at mykolab.com
Wed Dec 13 19:12:20 UTC 2017


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++)


More information about the freebsd-hackers mailing list