mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 16:36:25 +00:00
stdlib: fix SDL_strtol of "0" with base 0
SDL_strtol("0") skipped the "0" octal prefix and returned a failure because the remainder of the string was empty.
This commit is contained in:

committed by
Anonymous Maarten

parent
54752f8d1c
commit
b713e7581b
@@ -368,7 +368,7 @@ static size_t SDL_ScanUnsignedLongLongInternal(const char *text, int count, int
|
||||
negative = *text == '-';
|
||||
++text;
|
||||
}
|
||||
if ((radix == 0 || radix == 16) && *text == '0') {
|
||||
if ((radix == 0 || radix == 16) && *text == '0' && text[1] != '\0') {
|
||||
++text;
|
||||
if (*text == 'x' || *text == 'X') {
|
||||
radix = 16;
|
||||
|
Reference in New Issue
Block a user