LibC: printf now prints 0 as integer

This commit is contained in:
Bananymous 2023-05-11 18:20:37 +03:00
parent fb1bab7c30
commit 1a0fdc5a44
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ static void integer_to_string(char* buffer, T value, int base, bool upper, const
value = -(value / base);
}
if (value == 0 && width > 0)
buffer[offset++] = '0';
while (value)
{
buffer[offset++] = digit_char(value % base, upper);