From 9ce0ecbe384f09030cd5d014e17179725e778fa6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 24 Mar 2004 22:05:34 +0000 Subject: Update. 2004-03-24 Jakub Jelinek * 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. --- stdlib/strtod_l.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'stdlib/strtod_l.c') diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c index 89d30b4..9eca802 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]; -- cgit v1.1