Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r--newlib/libc/stdio/vfprintf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index a96ce0c7d..117f7eb80 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -805,9 +805,11 @@ number: if ((dprec = prec) >= 0)
}
} else if (expt <= 0) {
PRINT("0", 1);
- PRINT(decimal_point, 1);
- PAD(-expt, zeroes);
- PRINT(cp, ndig);
+ if(ndig) {
+ PRINT(decimal_point, 1);
+ PAD(-expt, zeroes);
+ PRINT(cp, ndig);
+ }
} else if (expt >= ndig) {
PRINT(cp, ndig);
PAD(expt - ndig, zeroes);