LibCore: Allow ConfigFile::read_num_entry to handle negative numbers

Previously, this function was using `AK::String::to_uint()`, which is
wrong considering the function returns type `int`. This also means that
configuration files would revert to the default value on negative
values.
This commit is contained in:
Jesse Buhagiar 2020-02-26 21:37:36 +11:00 committed by Andreas Kling
parent d879102549
commit 22cdf12ec4
Notes: sideshowbarker 2024-07-19 09:03:25 +09:00

View file

@ -132,7 +132,7 @@ int ConfigFile::read_num_entry(const String& group, const String& key, int defau
}
bool ok;
int value = read_entry(group, key).to_uint(ok);
int value = read_entry(group, key).to_int(ok);
if (!ok)
return default_value;
return value;