summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-08-22 10:47:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:10 -0500
commitaa1c863063619524361d0e4003149edd2c3fa3a8 (patch)
tree1b2dae3ea91aa425b377928964737e00061d2c8c /source3
parentd94d58a46f7105001bbc2a312dc99b1866956ead (diff)
downloadsamba-aa1c863063619524361d0e4003149edd2c3fa3a8.tar.gz
samba-aa1c863063619524361d0e4003149edd2c3fa3a8.tar.bz2
samba-aa1c863063619524361d0e4003149edd2c3fa3a8.zip
r24616: In set_boolean(), only pass the result back to the caller
if parsing of the boolean string was successful. Also, initialize the local result variable (although not strictly necessary anymore, now.) (This used to be commit bf0daa74fadcd506b80c29d04ccf6ec7345ee0e1)
Diffstat (limited to 'source3')
-rw-r--r--source3/param/loadparm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 6e05e5e554..adcf3522ee 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -3090,6 +3090,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue)
BOOL value;
bRetval = True;
+ value = False;
if (strwicmp(pszParmValue, "yes") == 0 ||
strwicmp(pszParmValue, "true") == 0 ||
strwicmp(pszParmValue, "1") == 0)
@@ -3105,7 +3106,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue)
bRetval = False;
}
- if (pb != NULL) {
+ if ((pb != NULL) && (bRetval != False)) {
*pb = value;
}