From aa1c863063619524361d0e4003149edd2c3fa3a8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 22 Aug 2007 10:47:32 +0000 Subject: 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) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') 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; } -- cgit