]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Move conv_str_bool() to its only user
authorVolker Lendecke <vl@samba.org>
Sun, 25 Jan 2026 10:17:30 +0000 (11:17 +0100)
committerAnoop C S <anoopcs@samba.org>
Sun, 15 Feb 2026 10:42:33 +0000 (10:42 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
lib/util/samba_util.h
lib/util/util_str.c
source4/client/cifsdd.c

index d67200ba70504003d7494f4742b08f8cef7000e3..25e55be3836d8f225ca44473166ae84353ec4db7 100644 (file)
@@ -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.
  **/
index a88301d71b392d86c7cb6f0c2a9db2f39da36193..8fbfc32e0ecb17cfac49559b3551067f5ca878ce 100644 (file)
  * @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.
  **/
index d6731c0ae2b67c13c60a77b8146062838ffb91e1..09e59ba148fcf0e7e3047466ec881029eef4938a 100644 (file)
@@ -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;