LibC: Fix printf thread safety

I don't know why I was using a static buffer for value conversions :D
This commit is contained in:
2026-04-21 00:25:56 +03:00
parent 558ed8fd44
commit ea4c34fc0b

View File

@@ -274,6 +274,8 @@ static void floating_point_to_maybe_exponent_string(char* buffer, T value, bool
extern "C" int printf_impl(const char* format, va_list arguments, int (*putc_fun)(int, void*), void* data)
{
char conversion[4096];
int written = 0;
while (*format)
{
@@ -383,9 +385,6 @@ extern "C" int printf_impl(const char* format, va_list arguments, int (*putc_fun
format--;
format++;
// FIXME: this should be thread-local to keep
// satisfy multithreaded requirement
static char conversion[4096];
const char* string = nullptr;
int length = -1;