(___printf_fp): Fix special case of #.0g and value rounded to 1.0.
authordrepper <drepper>
Sun, 29 Jul 2007 00:25:19 +0000 (00:25 +0000)
committerdrepper <drepper>
Sun, 29 Jul 2007 00:25:19 +0000 (00:25 +0000)
stdio-common/printf_fp.c

index 6e5ff58..ae25ab6 100644 (file)
@@ -986,7 +986,9 @@ ___printf_fp (FILE *fp,
            if (*wtp != decimalwc)
              /* Round up.  */
              (*wtp)++;
-           else if (__builtin_expect (spec == 'g' && type == 'f' && info->alt,
+           else if (__builtin_expect (spec == 'g' && type == 'f' && info->alt
+                                      && wtp == wstartp + 1
+                                      && wstartp[0] == L'0',
                                       0))
              /* This is a special case: the rounded number is 1.0,
                 the format is 'g' or 'G', and the alternative format