From 22cdf12ec4f2263b6fd1c3bb1033ba2d6e186578 Mon Sep 17 00:00:00 2001 From: Jesse Buhagiar Date: Wed, 26 Feb 2020 21:37:36 +1100 Subject: [PATCH] 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. --- Libraries/LibCore/ConfigFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/ConfigFile.cpp b/Libraries/LibCore/ConfigFile.cpp index 19e42469f4..08fdb130ff 100644 --- a/Libraries/LibCore/ConfigFile.cpp +++ b/Libraries/LibCore/ConfigFile.cpp @@ -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;