From 883ebe6692ebf0ce7e51af2a688484662804f47c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Feb 1998 12:41:27 +0000 Subject: [PATCH] (STRTOF): Don't call lshift with zero count. --- stdlib/strtod.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 -- 2.47.2