summaryrefslogtreecommitdiff
path: root/stdio-common/printf_fp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-04-16 23:59:09 +0000
committerJakub Jelinek <jakub@redhat.com>2007-04-16 23:59:09 +0000
commite220c524c93b053a1dea504a2d18288ff8f32b9a (patch)
tree4193293c838a7db46f2cc0c2b50cb8601dcddb8d /stdio-common/printf_fp.c
parenta891c7b0e014df5df027249f59cb444b87afdf30 (diff)
Updated to fedora-glibc-20070416T2350cvs/fedora-glibc-2_5_90-21
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r--stdio-common/printf_fp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index c27c0d496c..9b796eac2f 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -990,7 +990,7 @@ ___printf_fp (FILE *fp,
0))
/* This is a special case: the rounded number is 1.0,
the format is 'g' or 'G', and the alternative format
- is selected. This means the result mist be "1.". */
+ is selected. This means the result must be "1.". */
--added_zeros;
}
@@ -1081,12 +1081,17 @@ ___printf_fp (FILE *fp,
/* This is another special case. The exponent of the number is
really smaller than -4, which requires the 'e'/'E' format.
But after rounding the number has an exponent of -4. */
- assert (wcp >= wstartp + 2);
+ assert (wcp >= wstartp + 1);
assert (wstartp[0] == L'1');
__wmemcpy (wstartp, L"0.0001", 6);
wstartp[1] = decimalwc;
- wmemset (wstartp + 6, L'0', wcp - (wstartp + 2));
- wcp += 4;
+ if (wcp >= wstartp + 2)
+ {
+ wmemset (wstartp + 6, L'0', wcp - (wstartp + 2));
+ wcp += 4;
+ }
+ else
+ wcp += 5;
}
else
{