Date: Wed, 13 Dec 2017 12:05:42 -0800 From: Cy Schubert <Cy.Schubert@komquats.com> To: Michael McConville <mmcco@mykolab.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Possibly misordered arguments to memset(3) Message-ID: <201712132005.vBDK5g6G003753@slippy.cwsent.com> In-Reply-To: Message from Michael McConville <mmcco@mykolab.com> of "Wed, 13 Dec 2017 12:02:31 -0700." <20171213190230.gf5gax7vswakgrd4@t240>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20171213190230.gf5gax7vswakgrd4@t240>, Michael McConville writes: > 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++) Good catch. Looks like it's been corrected already. -- Cheers, Cy Schubert <Cy.Schubert@cschubert.com> FreeBSD UNIX: <cy@FreeBSD.org> Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712132005.vBDK5g6G003753>