mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue