Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2012 21:58:12 -0400
From:      Eitan Adler <eadler@freebsd.org>
To:        Jason Hellenthal <jhellenthal@dataix.net>
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:  <CAF6rxgkhiznBRU04%2Bc%2BDPdBj9Omg03SqeSd9-0Ct-FfxAVm95g@mail.gmail.com>
In-Reply-To: <20120319015203.GB13456@DataIX.net>
References:  <201203190127.q2J1RtgB044557@svn.freebsd.org> <20120319015203.GB13456@DataIX.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 18, 2012 at 9:52 PM, Jason Hellenthal
<jhellenthal@dataix.net> wrote:
>
>
> 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:
>> =C2=A0 MFC r232503:
>> =C2=A0 =C2=A0 =C2=A0 POSIX mandates that swab do nothing when len < 0
>>
>> =C2=A0 PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 140690
>> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0cperciva
>>
>> Modified: stable/8/lib/libc/string/swab.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- stable/8/lib/libc/string/swab.c =C2=A0 Mon Mar 19 01:27:30 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233146)
>> +++ stable/8/lib/libc/string/swab.c =C2=A0 Mon Mar 19 01:27:55 2012 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0(r233147)
>> @@ -45,6 +45,8 @@ swab(const void * __restrict from, void
>> =C2=A0 =C2=A0 =C2=A0 int n;
>> =C2=A0 =C2=A0 =C2=A0 char *fp, *tp;
>>
>> + =C2=A0 =C2=A0 if (len <=3D 0)
>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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...

If the code doesn't check for len <=3D 0 then it will do something.


--=20
Eitan Adler
Source & Ports committer
X11, Bugbusting teams



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgkhiznBRU04%2Bc%2BDPdBj9Omg03SqeSd9-0Ct-FfxAVm95g>