diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2001-02-28 16:38:26 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2001-02-28 16:38:26 +0000 |
commit | 57e9510d983d40d7ad26cfaa27f7f285d090bf3f (patch) | |
tree | 5bc8458c769a2cb2768550eaa3e007d7b96e90e8 | |
parent | faec125f35d86af53f8d38a0ef914cb584ed7b6b (diff) |
Fix a buglet regarding floating point output for ?nprintf functions.
-rw-r--r-- | libc/stdio/printf.c | 3 |
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)), |