]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 29 Oct 1999 23:53:04 +0000 (23:53 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 29 Oct 1999 23:53:04 +0000 (23:53 +0000)
1999-10-29  Ulrich Drepper  <drepper@cygnus.com>

* stdlib/strtod.c: Handle hexadecimal numbers with leading digit
!= 1 correctly.

ChangeLog
stdlib/strtod.c

index ef35f05cbc29508606a0595c71094c88cf3a347f..cf0e359fd2baf33dcbe088a33b73a403a4f96af9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * sysdeps/generic/ifreq.h: New file.
index 7502799edf9de88634b74148821bf6ad50490f50..4a3c8a27252f1f195eea87c2adfb74a0db781198 100644 (file)
@@ -797,11 +797,15 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM)
 
       while (!ISXDIGIT (*startp))
        ++startp;
+      while (*startp == L_('0'))
+       ++startp;
       if (ISDIGIT (*startp))
        val = *startp++ - L_('0');
       else
        val = 10 + TOLOWER (*startp++) - L_('a');
       bits = nbits[val];
+      /* We cannot have a leading zero.  */
+      assert (bits != 0);
 
       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);
        }
 
+      /* Adjust the exponent for the bits we are shifting in.  */
+      exponent += bits - 1;
+
       while (--dig_no > 0 && idx >= 0)
        {
          while (!ISXDIGIT (*startp))