summaryrefslogtreecommitdiffstats
path: root/newlib/libc/machine/powerpc/vfprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/powerpc/vfprintf.c')
-rw-r--r--newlib/libc/machine/powerpc/vfprintf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/newlib/libc/machine/powerpc/vfprintf.c b/newlib/libc/machine/powerpc/vfprintf.c
index 8aadb4b15..e84be15aa 100644
--- a/newlib/libc/machine/powerpc/vfprintf.c
+++ b/newlib/libc/machine/powerpc/vfprintf.c
@@ -321,7 +321,7 @@ _DEFUN (VFPRINTF, (fp, fmt0, ap),
_CONST char *fmt0 _AND
va_list ap)
{
- CHECK_INIT (_REENT);
+ CHECK_INIT (_REENT, fp);
return _VFPRINTF_R (_REENT, fp, fmt0, ap);
}
@@ -875,7 +875,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)