Fixed SDL_GetStringInteger() for values starting with '0' and '1' (thanks @DanielGibson!)

This commit is contained in:
Sam Lantinga
2024-10-07 15:53:38 -07:00
parent 7da728a642
commit 5db64300b8

View File

@@ -237,10 +237,10 @@ int SDL_GetStringInteger(const char *value, int default_value)
if (!value || !*value) {
return default_value;
}
if (*value == '0' || SDL_strcasecmp(value, "false") == 0) {
if (SDL_strcasecmp(value, "false") == 0) {
return 0;
}
if (*value == '1' || SDL_strcasecmp(value, "true") == 0) {
if (SDL_strcasecmp(value, "true") == 0) {
return 1;
}
if (*value == '-' || SDL_isdigit(*value)) {