mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andreas Kling
parent
d879102549
commit
22cdf12ec4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user