]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(STRTOF): Don't call lshift with zero count.
authorUlrich Drepper <drepper@redhat.com>
Thu, 26 Feb 1998 12:41:27 +0000 (12:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 26 Feb 1998 12:41:27 +0000 (12:41 +0000)
stdlib/strtod.c

index 7398898abc24f34a7cdc476123806ac38b8b8540..9aa120c87a7aa4ff3f57cccba571041aebee1a3f 100644 (file)
@@ -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 <drepper@gnu.ai.mit.edu>, 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