svn commit: r233147 - stable/8/lib/libc/string
Jason Hellenthal
jhellenthal at dataix.net
Mon Mar 19 01:52:08 UTC 2012
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 at 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 at freebsd.org"
--
;s =;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120319/e2fba6e5/attachment.pgp
More information about the svn-src-all
mailing list