From: Volker Lendecke Date: Sun, 25 Jan 2026 10:17:30 +0000 (+0100) Subject: lib: Move conv_str_bool() to its only user X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f302274ed3c3f73cbdb8bf67aefa6a87855e18f3;p=thirdparty%2Fsamba.git lib: Move conv_str_bool() to its only user Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index d67200ba705..25e55be3836 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -294,15 +294,6 @@ _PUBLIC_ size_t ascii_len_n(const char *src, size_t n); **/ _PUBLIC_ bool set_boolean(const char *boolean_string, bool *boolean); -/** - * Parse a string containing a boolean value. - * - * val will be set to the read value. - * - * @retval true if a boolean value was parsed, false otherwise. - */ -_PUBLIC_ bool conv_str_bool(const char * str, bool * val); - /** * Convert a size specification like 16K into an integral number of bytes. **/ diff --git a/lib/util/util_str.c b/lib/util/util_str.c index a88301d71b3..8fbfc32e0ec 100644 --- a/lib/util/util_str.c +++ b/lib/util/util_str.c @@ -33,31 +33,6 @@ * @brief String utilities. **/ -/** - * Parse a string containing a boolean value. - * - * val will be set to the read value. - * - * @retval true if a boolean value was parsed, false otherwise. - */ -_PUBLIC_ bool conv_str_bool(const char * str, bool * val) -{ - char * end = NULL; - long lval; - - if (str == NULL || *str == '\0') { - return false; - } - - lval = strtol(str, &end, 10 /* base */); - if (end == NULL || *end != '\0' || end == str) { - return set_boolean(str, val); - } - - *val = (lval) ? true : false; - return true; -} - /** * Convert a size specification like 16K into an integral number of bytes. **/ diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index d6731c0ae2b..09e59ba148f 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -163,6 +163,31 @@ static struct argdef * find_named_arg(const char * arg) return(NULL); } +/** + * Parse a string containing a boolean value. + * + * val will be set to the read value. + * + * @retval true if a boolean value was parsed, false otherwise. + */ +static bool conv_str_bool(const char *str, bool *val) +{ + char *end = NULL; + long lval; + + if (str == NULL || *str == '\0') { + return false; + } + + lval = strtol(str, &end, 10 /* base */); + if (end == NULL || *end != '\0' || end == str) { + return set_boolean(str, val); + } + + *val = (lval) ? true : false; + return true; +} + int set_arg_argv(const char * argv) { struct argdef * arg;