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:
parent
1ce1958f7a
commit
bf0daa74fa
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user