mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
1999-10-29 Ulrich Drepper <drepper@cygnus.com> * stdlib/strtod.c: Handle hexadecimal numbers with leading digit != 1 correctly.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
1999-10-29 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* stdlib/strtod.c: Handle hexadecimal numbers with leading digit
|
||||||
|
!= 1 correctly.
|
||||||
|
|
||||||
1999-10-27 Andreas Jaeger <aj@suse.de>
|
1999-10-27 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
* sysdeps/generic/ifreq.h: New file.
|
* sysdeps/generic/ifreq.h: New file.
|
||||||
|
@ -797,11 +797,15 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM)
|
|||||||
|
|
||||||
while (!ISXDIGIT (*startp))
|
while (!ISXDIGIT (*startp))
|
||||||
++startp;
|
++startp;
|
||||||
|
while (*startp == L_('0'))
|
||||||
|
++startp;
|
||||||
if (ISDIGIT (*startp))
|
if (ISDIGIT (*startp))
|
||||||
val = *startp++ - L_('0');
|
val = *startp++ - L_('0');
|
||||||
else
|
else
|
||||||
val = 10 + TOLOWER (*startp++) - L_('a');
|
val = 10 + TOLOWER (*startp++) - L_('a');
|
||||||
bits = nbits[val];
|
bits = nbits[val];
|
||||||
|
/* We cannot have a leading zero. */
|
||||||
|
assert (bits != 0);
|
||||||
|
|
||||||
if (pos + 1 >= 4 || pos + 1 >= bits)
|
if (pos + 1 >= 4 || pos + 1 >= bits)
|
||||||
{
|
{
|
||||||
@ -819,6 +823,9 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM)
|
|||||||
pos = BITS_PER_MP_LIMB - 1 - (bits - pos - 1);
|
pos = BITS_PER_MP_LIMB - 1 - (bits - pos - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Adjust the exponent for the bits we are shifting in. */
|
||||||
|
exponent += bits - 1;
|
||||||
|
|
||||||
while (--dig_no > 0 && idx >= 0)
|
while (--dig_no > 0 && idx >= 0)
|
||||||
{
|
{
|
||||||
while (!ISXDIGIT (*startp))
|
while (!ISXDIGIT (*startp))
|
||||||
|
Reference in New Issue
Block a user