summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-21 15:47:27 +1300
committerJeremy Allison <jra@samba.org>2014-05-07 19:49:16 +0200
commita8cfa8b1f250acfe9897fc93d8e4b19362078afd (patch)
tree437e6d8f527c4b286dd09119de0b34010c63e6e3
parenta5407922577e5f228df3e53f8b8996123672a06b (diff)
downloadsamba-a8cfa8b1f250acfe9897fc93d8e4b19362078afd.tar.gz
samba-a8cfa8b1f250acfe9897fc93d8e4b19362078afd.tar.xz
samba-a8cfa8b1f250acfe9897fc93d8e4b19362078afd.zip
lib/param: use lp_set_enum_parm
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/param/loadparm.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 06a8f02b620..4cc2da81aae 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1479,19 +1479,7 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
break;
case P_ENUM:
- for (i = 0; parm_table[parmnum].enum_list[i].name; i++) {
- if (strequal
- (pszParmValue,
- parm_table[parmnum].enum_list[i].name)) {
- *(int *)parm_ptr =
- parm_table[parmnum].
- enum_list[i].value;
- break;
- }
- }
- if (!parm_table[parmnum].enum_list[i].name) {
- DEBUG(0,("Unknown enumerated value '%s' for '%s'\n",
- pszParmValue, pszParmName));
+ if (!lp_set_enum_parm(&parm_table[parmnum], pszParmValue, (int*)parm_ptr)) {
return false;
}
break;