summaryrefslogtreecommitdiff
path: root/libc/stdio/printf.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-02-28 16:38:26 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-02-28 16:38:26 +0000
commit57e9510d983d40d7ad26cfaa27f7f285d090bf3f (patch)
tree5bc8458c769a2cb2768550eaa3e007d7b96e90e8 /libc/stdio/printf.c
parentfaec125f35d86af53f8d38a0ef914cb584ed7b6b (diff)
Fix a buglet regarding floating point output for ?nprintf functions.
Diffstat (limited to 'libc/stdio/printf.c')
-rw-r--r--libc/stdio/printf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdio/printf.c b/libc/stdio/printf.c
index 06cf6a5b2..e031f8cb9 100644
--- a/libc/stdio/printf.c
+++ b/libc/stdio/printf.c
@@ -558,7 +558,8 @@ int vfnprintf(FILE * op, size_t max_size, const char *fmt, va_list ap)
if (preci < 0) {
preci = 6;
}
- cnt += __dtostr(op, max_size,
+ cnt += __dtostr(op,
+ (max_size > cnt ? max_size - cnt : 0),
(long double) ((lval > 1)
? va_arg(ap, long double)
: va_arg(ap, double)),