summaryrefslogtreecommitdiff
path: root/libc/stdio
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
parentfaec125f35d86af53f8d38a0ef914cb584ed7b6b (diff)
Fix a buglet regarding floating point output for ?nprintf functions.
Diffstat (limited to 'libc/stdio')
-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)),