1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

LibC: Support X modifier for scanf

This was currently crashing Half-Life because it was a considered an
"Unknown" specifier. We can use the same case statement as the regular
hex format conversion (lower case 'x'), as the backend
to convert the number already supports upper/lower case input, hence
we get it for free :^)
This commit is contained in:
Jesse Buhagiar 2022-01-01 21:11:02 +11:00 committed by Idan Horowitz
parent 022b4a3ed3
commit 2de7f2021d
2 changed files with 4 additions and 0 deletions

View file

@ -488,6 +488,7 @@ extern "C" int vsscanf(const char* input, const char* format, va_list ap)
conversion_specifier = ConversionSpecifier::Unsigned;
break;
case 'x':
case 'X':
format_lexer.consume();
conversion_specifier = ConversionSpecifier::Hex;
break;