summaryrefslogtreecommitdiffstats
path: root/source/param
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
commitbf0daa74fadcd506b80c29d04ccf6ec7345ee0e1 (patch)
tree0994ac737137127d5bee575b75d2443c67b3a162 /source/param
parent1ce1958f7a5f41072ad1e2f1fb55f3cd4ebe4b14 (diff)
downloadsamba-bf0daa74fadcd506b80c29d04ccf6ec7345ee0e1.tar.gz
samba-bf0daa74fadcd506b80c29d04ccf6ec7345ee0e1.tar.xz
samba-bf0daa74fadcd506b80c29d04ccf6ec7345ee0e1.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.)
Diffstat (limited to 'source/param')
-rw-r--r--source/param/loadparm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 6e05e5e5547..adcf3522ee1 100644
--- a/source/param/loadparm.c
+++ b/source/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;
}