diff --git a/kernel/src/std/stdio.cpp b/kernel/src/std/stdio.cpp index 97b2fde3..9b1dc0b0 100644 --- a/kernel/src/std/stdio.cpp +++ b/kernel/src/std/stdio.cpp @@ -159,6 +159,14 @@ static int internal_printf(const char* format, PutString put_string_callback, ss } break; } + case 'p': { + char result[25]; + ultoa(va_arg(ap, uint64_t), result, 16); + if (buffer_insert_index + strlen(result) > 1024) flush_buffer(); + memcpy(buffer + buffer_insert_index, result, strlen(result)); + buffer_insert_index += strlen(result); + if (buffer_insert_index == 1024) flush_buffer(); + } case 's': { const char* str = va_arg(ap, const char*); while (strlen(str) > 1024) diff --git a/libs/libc/src/printf.cpp b/libs/libc/src/printf.cpp index 9d2efbb3..c978c270 100644 --- a/libs/libc/src/printf.cpp +++ b/libs/libc/src/printf.cpp @@ -242,6 +242,14 @@ static int internal_printf(const char* format, PutString put_string_callback, ss } break; } + case 'p': { + char result[25]; + __unsignedtoa(va_arg(ap, uint64_t), result, 16); + if (buffer_insert_index + strlen(result) > 1024) flush_buffer(); + memcpy(buffer + buffer_insert_index, result, strlen(result)); + buffer_insert_index += strlen(result); + if (buffer_insert_index == 1024) flush_buffer(); + } case 's': { const char* str = va_arg(ap, const char*); while (strlen(str) > 1024)