From 7085323d7027195567ae00e93279b717666180af Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Sat, 23 Jul 2016 12:01:52 +0100 Subject: [PATCH] Correct return code from setting_get_priority(). The function was returning 1 when filling the destination buffer with the default value. It should return 0 when the value is default and 1 when it has been set by the administrator. --- settings.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/settings.cpp b/settings.cpp index c85bab4..f50dcc4 100644 --- a/settings.cpp +++ b/settings.cpp @@ -452,7 +452,9 @@ static int setting_get_priority(const TCHAR *service_name, void *param, const TC unsigned long constant; switch (get_number(key, (TCHAR *) name, &constant, false)) { - case 0: return value_from_string(name, value, (const TCHAR *) default_value); + case 0: + if (value_from_string(name, value, (const TCHAR *) default_value) == -1) return -1; + return 0; case -1: return -1; } -- 2.7.4