aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2003-07-29 20:45:11 +0000
committerJeff Johnston <jjohnstn@redhat.com>2003-07-29 20:45:11 +0000
commit42de5592999686f239f67ce8c785c55f84537187 (patch)
tree29930d57d7e27cce52fd4f781909d4c6ef28417a /newlib
parente4bf124e034201f5668de37f6c6137af283a0a2a (diff)
downloadnewlib-42de5592999686f239f67ce8c785c55f84537187.zip
newlib-42de5592999686f239f67ce8c785c55f84537187.tar.gz
newlib-42de5592999686f239f67ce8c785c55f84537187.tar.bz2
2003-07-29 Honda Hiroki <hhonda@ipflex.com>
* libc/stdio/vfprintf.c: Set output size to 1 when we have %f format with precision 0 and # flag not specified.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/vfprintf.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 4f28001..ee43302 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-29 Honda Hiroki <hhonda@ipflex.com>
+
+ * libc/stdio/vfprintf.c: Set output size to 1 when
+ we have %f format with precision 0 and # flag not specified.
+
2003-07-29 Alexandre Oliva <aoliva@redhat.com>
* libc/machine/mn10300/setjmp.S: Never emit both .am33 and
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index 8225573..c10103d 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -830,7 +830,9 @@ reswitch: switch (ch) {
if (prec || flags & ALT)
size += prec + 1;
} else /* "0.X" */
- size = prec + 2;
+ size = (prec || flags & ALT)
+ ? prec + 2
+ : 1;
} else if (expt >= ndig) { /* fixed g fmt */
size = expt;
if (flags & ALT)