[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: Possibly misordered arguments to memset(3)
From:       Cy Schubert <Cy.Schubert () komquats ! com>
Date:       2017-12-13 20:05:42
Message-ID: 201712132005.vBDK5g6G003753 () slippy ! cwsent ! com
[Download RAW message or body]

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.


_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic