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
commit 2de7f2021d
Notes: sideshowbarker 2024-07-17 21:48:51 +09:00
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;