From: Ulrich Drepper Date: Thu, 26 Feb 1998 12:41:27 +0000 (+0000) Subject: (STRTOF): Don't call lshift with zero count. X-Git-Tag: cvs/before-sparc-2_0_x-branch~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=883ebe6692ebf0ce7e51af2a688484662804f47c;p=thirdparty%2Fglibc.git (STRTOF): Don't call lshift with zero count. --- diff --git a/stdlib/strtod.c b/stdlib/strtod.c index 7398898abc2..9aa120c87a7 100644 --- a/stdlib/strtod.c +++ b/stdlib/strtod.c @@ -1,6 +1,6 @@ /* Read decimal floating point numbers. This file is part of the GNU C Library. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. The GNU C Library is free software; you can redistribute it and/or @@ -874,10 +874,13 @@ INTERNAL (STRTOF) (nptr, endptr, group) count_leading_zeros (cnt, den[densize - 1]); - (void) __mpn_lshift (den, den, densize, cnt); - cy = __mpn_lshift (num, num, numsize, cnt); - if (cy != 0) - num[numsize++] = cy; + if (cnt > 0) + { + (void) __mpn_lshift (den, den, densize, cnt); + cy = __mpn_lshift (num, num, numsize, cnt); + if (cy != 0) + num[numsize++] = cy; + } /* Now we are ready for the division. But it is not necessary to do a full multi-precision division because we only need a small