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

(cherry picked from commit d4f9e32639)
This commit is contained in:
Ahmad Khalifa 2024-08-31 06:42:04 +03:00 committed by Warner Losh
parent 0ca77a6363
commit 2ce4f02182
2 changed files with 4 additions and 12 deletions

View file

@ -294,13 +294,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

@ -374,13 +374,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