mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
printf: Support dynamic fill widths
The printf formatting mini-language actually allows you to pass a '*' character in place of the fill width specification, in which case it eats one of the passed in arguments and uses it as width, so implement that.
This commit is contained in:
parent
cfe8fdd5aa
commit
79f867238a
|
@ -222,6 +222,11 @@ template<typename PutChFunc>
|
|||
if (*(p + 1))
|
||||
goto one_more;
|
||||
}
|
||||
if (*p == '*') {
|
||||
fieldWidth = va_arg(ap, int);
|
||||
if (*(p + 1))
|
||||
goto one_more;
|
||||
}
|
||||
if (*p == 'l') {
|
||||
++long_qualifiers;
|
||||
if (*(p + 1))
|
||||
|
|
Loading…
Reference in a new issue