mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 21:15:09 +00:00
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:
parent
d879102549
commit
22cdf12ec4
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue