From: Iain Patterson Date: Sat, 23 Jul 2016 11:01:52 +0000 (+0100) Subject: Correct return code from setting_get_priority(). X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;ds=sidebyside;h=7085323d7027195567ae00e93279b717666180af;p=nssm.git 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. --- 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; }