mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibC: Teach vsscanf()
to consume the width specifier
Previously, `vsscanf()` would crash whenever it encountered a width specification. Now, it consumes the width specification but does not yet do anything with it.
This commit is contained in:
parent
7f1f6d96b4
commit
5e5f0245b6
2 changed files with 9 additions and 0 deletions
|
@ -418,6 +418,14 @@ extern "C" int vsscanf(const char* input, const char* format, va_list ap)
|
|||
|
||||
format_lexer.ignore(); // '%'
|
||||
|
||||
// Parse width specification
|
||||
[[maybe_unused]] int width_specifier = 0;
|
||||
if (format_lexer.next_is(isdigit)) {
|
||||
auto width_digits = format_lexer.consume_while([](char c) { return isdigit(c); });
|
||||
width_specifier = width_digits.to_int().value();
|
||||
// FIXME: Actually use width specifier
|
||||
}
|
||||
|
||||
bool invert_scanlist = false;
|
||||
StringView scanlist;
|
||||
LengthModifier length_modifier { None };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue