fix strtod("-0x",NULL)

Jeff Johnston jjohnstn@redhat.com
Fri Mar 7 15:05:00 GMT 2008


Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Jeff Johnston on 2/21/2008 8:59 AM:
> |> strtod is required to parse out the longest sequence of the expected
> |> form.  Since "-0x" is not a valid hex constant, strtod should fall
> |> back and parse the valid "-0" as -0.0, rather than claiming that the
> |> input is invalid and returning +0.0.  OK to apply?
>
> And another one - strtod("nan()", ptr) should consume the () (per C99, 
> the
> n-char-sequence between the literal () is optional, not required).
> Without the patch, ptr is set to str+3 instead of str+5.  OK to apply?
>

Ok.

> 2008-02-29  Eric Blake  <ebb9@byu.net>
>
>     Fix strtod("nan()", ptr).
>     * libc/stdlib/gdtoa-hexnan.c (hexnan): When the optional
>     n-char-sequence is omitted, still parse the ().
>
> - --
> Don't work too hard, make some time for fun as well!
>
> Eric Blake             ebb9@byu.net
> -----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
>
> iD8DBQFHx4ra84KuGfSFAYARApQtAKDFS9LK859EtElZv2qCdbkhe8TDOwCgsNI/
> 0uqPgc34aCrupluyduEDihk=
> =N3vo
> -----END PGP SIGNATURE-----



More information about the Newlib mailing list