aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-24 22:05:34 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-24 22:05:34 +0000
commit9ce0ecbe384f09030cd5d014e17179725e778fa6 (patch)
treefe311a312021ab640083716643ac2c891d54bb10 /stdlib
parent6abbc50157efd0a8cec43827774307c9dc2a6493 (diff)
downloadglibc-9ce0ecbe384f09030cd5d014e17179725e778fa6.tar
glibc-9ce0ecbe384f09030cd5d014e17179725e778fa6.tar.gz
glibc-9ce0ecbe384f09030cd5d014e17179725e778fa6.tar.bz2
glibc-9ce0ecbe384f09030cd5d014e17179725e778fa6.zip
Update.
2004-03-24 Jakub Jelinek <jakub@redhat.com> * stdlib/strtod_l.c (INTERNAL (__STRTOF)): Clear the rest of retval, not just one limb if RETURN_LIMB_SIZE > 2. Fix shifting up if RETURN_LIMB_SIZE > 2. * stdio-common/printf_fp.c (__printf_fp): For IEEE quad long double on 32-bit architectures reserve 8 limbs instead of 4.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/strtod_l.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 89d30b435b..9eca802a10 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -1155,7 +1155,11 @@ INTERNAL (__STRTOF) (nptr, endptr, group, loc)
memcpy (retval, num, numsize * sizeof (mp_limb_t));
#if RETURN_LIMB_SIZE > 1
if (numsize < RETURN_LIMB_SIZE)
+# if RETURN_LIMB_SIZE == 2
retval[numsize] = 0;
+# else
+ MPN_ZERO (retval + numsize, RETURN_LIMB_SIZE - numsize);
+# endif
#endif
}
@@ -1461,8 +1465,10 @@ INTERNAL (__STRTOF) (nptr, endptr, group, loc)
__mpn_lshift_1 (retval, RETURN_LIMB_SIZE,
BITS_PER_MP_LIMB, 0);
#else
- for (i = RETURN_LIMB_SIZE; i > empty; --i)
+ for (i = RETURN_LIMB_SIZE - 1; i >= empty; --i)
retval[i] = retval[i - empty];
+ while (i >= 0)
+ retval[i--] = 0;
#endif
for (i = numsize; i > 0; --i)
num[i + empty] = num[i - 1];