mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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:
parent
d01b97b50a
commit
5bb18bf548
Notes:
sideshowbarker
2024-07-19 08:07:27 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/5bb18bf5487
@ -387,10 +387,10 @@ template<typename PutChFunc>
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, int), false, alternate_form, false, true, 2);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
putch(bufptr, (char)va_arg(ap, int));
|
||||
++ret;
|
||||
break;
|
||||
case 'c': {
|
||||
char s[2] { (char)va_arg(ap, int), 0 };
|
||||
ret += print_string(putch, bufptr, s, left_pad, fieldWidth, dot);
|
||||
} break;
|
||||
|
||||
case '%':
|
||||
putch(bufptr, '%');
|
||||
|
Loading…
Reference in New Issue
Block a user