1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

AK: Use print_string() for %c formatting

Instead of simply outputting the character. This way, we get proper padding
support and other niceties strings enjoy.
This commit is contained in:
Sergey Bugaev 2020-03-26 01:09:02 +03:00 committed by Andreas Kling
parent d01b97b50a
commit 5bb18bf548

View file

@ -387,10 +387,10 @@ template<typename PutChFunc>
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, false, true, 2); ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, false, true, 2);
break; break;
case 'c': case 'c': {
putch(bufptr, (char)va_arg(ap, int)); char s[2] { (char)va_arg(ap, int), 0 };
++ret; ret += print_string(putch, bufptr, s, left_pad, fieldWidth, dot);
break; } break;
case '%': case '%':
putch(bufptr, '%'); putch(bufptr, '%');