freebsd-src
freebsd-src copied to clipboard
libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c
With the new %b format specifier, we need at most 64 characters.
Also, the comment says that we need enough space to write a uintmax_t in octal plus one byte, I'm not sure what that's for. I guess its implying that we need a null terminator(?), but it doesn't look like we do.
This can be easily tested by doing:
printf("%lb\n", 1ul << n); /* Where n is anywhere from 32 to 63 */
Thinking about this some more, we should just be able to remove the whole conditional and make BUF sizeof(uintmax_t) * CHAR_BIT