Browse Source

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.
Iain Patterson 7 years ago
parent
commit
7085323d70
1 changed files with 3 additions and 1 deletions
  1. 3 1
      settings.cpp

+ 3 - 1
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;
   }