lib: Update error check for new string conversion wrapper
authorSwen Schillig <swen@linux.ibm.com>
Wed, 6 Mar 2019 08:07:13 +0000 (09:07 +0100)
committerChristof Schmitt <cs@samba.org>
Thu, 11 Apr 2019 22:29:26 +0000 (22:29 +0000)
The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/lib/interface.c
source3/lib/util_str.c

index 342c92a61a2185bdcb1a6c4d08695f46d56d4310..31066b8b5cc48fd6d44007d8d80537babcd87cec 100644 (file)
@@ -527,7 +527,7 @@ static void interpret_interface(char *token)
                unsigned long val;
 
                val = strtoul_err(p, &endp, 0, &error);
-               if (p == endp || (endp && *endp != '\0') || error != 0) {
+               if (error != 0 || *endp != '\0') {
                        DEBUG(2,("interpret_interface: "
                                "can't determine netmask value from %s\n",
                                p));
index a0095d23978e3b77aa8b03ab234540083e0eacb8..1a27227fe41300316dd90f579becfcd6c7b38807 100644 (file)
@@ -859,7 +859,7 @@ uint64_t conv_str_size(const char * str)
 
        lval = strtoull_err(str, &end, 10, &error);
 
-        if (end == NULL || end == str || error != 0) {
+        if (error != 0) {
                 return 0;
         }