[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getline() behaviour change
From: |
Eric Blake |
Subject: |
Re: getline() behaviour change |
Date: |
Wed, 22 Aug 2007 18:09:31 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Bruno Haible on 8/22/2007 3:25 PM:
>>
>> - if (*lineptr == NULL || *n == 0)
>> + if (*n == 0)
>
> This is a behaviour change: Previously when *lineptr == NULL, *n did not
> need to be initialized. Now it needs to be initialized to 0. Should be
> mentioned in NEWS.
Hmm, I agree. But the wording the draft 3 of POSIX 200x requires *n to be
initialized - if it is non-zero, then *lineptr must point to that many
bytes, so *n must be 0 if *lineptr is NULL when used in a manner compliant
with POSIX. Maybe it is worth a question on the Austin group mailing list
as to whether this is intentional? Or do we go ahead and be generous by
resetting *n to a sane value when *lineptr is NULL (ie. revert this one line)?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGzNA784KuGfSFAYARAmQeAJ41dT8abUd991cOKHxciQIro8dCfgCgqNsv
gxWCa3449T1Cv7vIpHiVU7s=
=cqbs
-----END PGP SIGNATURE-----
- Re: getline.h, (continued)
- Re: getline() behaviour change, Bruno Haible, 2007/08/22
- Re: getline() behaviour change, Jim Meyering, 2007/08/22
- Re: getline() behaviour change, Bruno Haible, 2007/08/22
- Re: getline() behaviour change, Ben Pfaff, 2007/08/22
- Re: getline() behaviour change, Eric Blake, 2007/08/22
- Re: getline() behaviour change, Jim Meyering, 2007/08/24
- Re: getline() behaviour change, Jim Meyering, 2007/08/23
- do not set errno after failing malloc [Re: getline() behaviour change, Jim Meyering, 2007/08/23
- Re: getline() behaviour change,
Eric Blake <=