summaryrefslogtreecommitdiff
path: root/stdio-common/printf_fp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-31 12:44:28 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-31 12:44:28 +0000
commit4416c6f1b73ded059060fa61a4aae73af8ef4025 (patch)
tree196722042e930340b49260eb22df8dff9a3fc3c6 /stdio-common/printf_fp.c
parented1e38d8c21a78b0a031aaf8824511ebd1cd96ee (diff)
downloadglibc-4416c6f1b73ded059060fa61a4aae73af8ef4025.tar
glibc-4416c6f1b73ded059060fa61a4aae73af8ef4025.tar.gz
glibc-4416c6f1b73ded059060fa61a4aae73af8ef4025.tar.bz2
glibc-4416c6f1b73ded059060fa61a4aae73af8ef4025.zip
2007-07-31 Jakub Jelinek <jakub@redhat.com>
* stdio-common/tfformat.c (sprint_doubles): Add 12 new tests. 2007-07-28 Ulrich Drepper <drepper@redhat.com> [BZ #4858] * stdio-common/printf_fp.c (___printf_fp): Fix special case of #.0g and value rounded to 1.0. * stdio-common/tfformat.c (sprint_doubles): Add two new tests.
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r--stdio-common/printf_fp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index c7a381a69d..b48b689661 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -985,7 +985,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