libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c

With the %b format specifier we need enough space to write a uintmax_t
in binary.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1400
This commit is contained in:
Ahmad Khalifa 2024-08-31 06:42:04 +03:00 committed by Warner Losh
parent df79daa0fd
commit d4f9e32639
3 changed files with 5 additions and 13 deletions

View File

@ -291,13 +291,9 @@ vfprintf(FILE * __restrict fp, const char * __restrict fmt0, va_list ap)
/*
* The size of the buffer we use as scratch space for integer
* conversions, among other things. We need enough space to
* write a uintmax_t in octal (plus one byte).
* write a uintmax_t in binary.
*/
#if UINTMAX_MAX <= UINT64_MAX
#define BUF 32
#else
#error "BUF must be large enough to format a uintmax_t"
#endif
#define BUF (sizeof(uintmax_t) * CHAR_BIT)
/*
* Non-MT-safe version

View File

@ -369,13 +369,9 @@ vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, va_list ap)
/*
* The size of the buffer we use as scratch space for integer
* conversions, among other things. We need enough space to
* write a uintmax_t in octal (plus one byte).
* write a uintmax_t in binary.
*/
#if UINTMAX_MAX <= UINT64_MAX
#define BUF 32
#else
#error "BUF must be large enough to format a uintmax_t"
#endif
#define BUF (sizeof(uintmax_t) * CHAR_BIT)
/*
* Non-MT-safe version

View File

@ -512,7 +512,7 @@ putchar(int c, void *arg)
if ((flags & TOTTY) && tp != NULL && !KERNEL_PANICKED())
tty_putchar(tp, c);
if ((flags & TOCONS ) && cn_mute) {
if ((flags & TOCONS) && cn_mute) {
flags &= ~TOCONS;
ap->flags = flags;
}