r24616: In set_boolean(), only pass the result back to the caller
authorMichael Adam <obnox@samba.org>
Wed, 22 Aug 2007 10:47:32 +0000 (10:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:10 +0000 (12:30 -0500)
if parsing of the boolean string was successful.
Also, initialize the local result variable
(although not strictly necessary anymore, now.)

source/param/loadparm.c

index 6e05e5e5547080fac1784df01a2e9b2ef96834c5..adcf3522ee1e3b8c498773c58adbd2c4912a79fc 100644 (file)
@@ -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;
        }