mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05: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
Notes:
sideshowbarker
2024-07-19 09:03:25 +09:00
Author: https://github.com/Quaker762 Commit: https://github.com/SerenityOS/serenity/commit/22cdf12ec4f Pull-request: https://github.com/SerenityOS/serenity/pull/1303
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…
Reference in a new issue