Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2012 21:52:03 -0400
From:      Jason Hellenthal <jhellenthal@dataix.net>
To:        Eitan Adler <eadler@freebsd.org>
Cc:        svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   Re: svn commit: r233147 - stable/8/lib/libc/string
Message-ID:  <20120319015203.GB13456@DataIX.net>
In-Reply-To: <201203190127.q2J1RtgB044557@svn.freebsd.org>
References:  <201203190127.q2J1RtgB044557@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]


On Mon, Mar 19, 2012 at 01:27:55AM +0000, Eitan Adler wrote:
> Author: eadler
> Date: Mon Mar 19 01:27:55 2012
> New Revision: 233147
> URL: http://svn.freebsd.org/changeset/base/233147
> 
> Log:
>   MFC r232503:
>   	POSIX mandates that swab do nothing when len < 0
>   
>   PR:		140690
>   Approved by:	cperciva
> 
> Modified: stable/8/lib/libc/string/swab.c
> ==============================================================================
> --- stable/8/lib/libc/string/swab.c	Mon Mar 19 01:27:30 2012	(r233146)
> +++ stable/8/lib/libc/string/swab.c	Mon Mar 19 01:27:55 2012	(r233147)
> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void 
>  	int n;
>  	char *fp, *tp;
>  
> +	if (len <= 0)
> +		return;

Does this not test to see if it is also equal to 0(zero) ?

If I understand the above statement "POSIX mandates that swab do nothing
when len < 0" then the above code should be exactly that ... and not
testing whether it is equal to zero...

>  	n = len >> 1;
>  	fp = (char *)from;
>  	tp = (char *)to;
> _______________________________________________
> svn-src-stable-8@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8
> To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org"

-- 
;s =;

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJPZpFCAAoJEJBXh4mJ2FR+yNUH/j7hn/2z1yoIcP0Tbux7lQaT
Y/z3W+dXCGGFuDkyIsoAQBF7zDAXqjUxjj0g/qJWakdq+SaRJA65v2AV8d1CYDbf
fFlv5JY9UsDpjyHD4Z2r33Xk2hgTB8lDyJLEgFrPhbS3x9AY9euQ6oE1TS0R3J3/
8I3Zde+MlU0c2g7ST3lZA4cKsKB8asl+fBd9NdpR7T7emryrLx2pjO+9ff9jeqpZ
Sol1QnVWzgTbHkJVrM2GM3Y/1mWdpkCLa4yYNAW20u0y7/KX/Z5fNeBUZVHYFoDV
wM8oioLDHhVc9d2fuWd6QaEwM5YYyh9BMC3SGALPNAAgIKwd1iOuDixKeufkmDg=
=4Hc8
-----END PGP SIGNATURE-----

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