forked from Bananymous/banan-os
LibC: Fix printf %c modifier for null byte
This commit is contained in:
parent
f55d6b11c5
commit
7691b019e2
|
@ -552,6 +552,7 @@ extern "C" int printf_impl(const char* format, va_list arguments, int (*putc_fun
|
||||||
conversion[0] = va_arg(arguments, int);
|
conversion[0] = va_arg(arguments, int);
|
||||||
conversion[1] = '\0';
|
conversion[1] = '\0';
|
||||||
string = conversion;
|
string = conversion;
|
||||||
|
length = 1;
|
||||||
format++;
|
format++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -633,7 +634,7 @@ extern "C" int printf_impl(const char* format, va_list arguments, int (*putc_fun
|
||||||
for (int i = length; i < options.width; i++)
|
for (int i = length; i < options.width; i++)
|
||||||
BAN_PRINTF_PUTC(' ');
|
BAN_PRINTF_PUTC(' ');
|
||||||
|
|
||||||
for (int i = 0; i < length && string[i]; i++)
|
for (int i = 0; i < length; i++)
|
||||||
BAN_PRINTF_PUTC(string[i]);
|
BAN_PRINTF_PUTC(string[i]);
|
||||||
|
|
||||||
if (options.left_justified)
|
if (options.left_justified)
|
||||||
|
|
Loading…
Reference in New Issue