1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 commit is contained in:
Michael Adam 2007-08-22 10:47:32 +00:00 committed by Gerald (Jerry) Carter
parent 1ce1958f7a
commit bf0daa74fa

View File

@ -3090,6 +3090,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue)
BOOL value; BOOL value;
bRetval = True; bRetval = True;
value = False;
if (strwicmp(pszParmValue, "yes") == 0 || if (strwicmp(pszParmValue, "yes") == 0 ||
strwicmp(pszParmValue, "true") == 0 || strwicmp(pszParmValue, "true") == 0 ||
strwicmp(pszParmValue, "1") == 0) strwicmp(pszParmValue, "1") == 0)
@ -3105,7 +3106,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue)
bRetval = False; bRetval = False;
} }
if (pb != NULL) { if ((pb != NULL) && (bRetval != False)) {
*pb = value; *pb = value;
} }