From: Swen Schillig Date: Wed, 6 Mar 2019 08:07:13 +0000 (+0100) Subject: lib: Update error check for new string conversion wrapper X-Git-Tag: tdb-1.4.1~456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7adaebe567ba969ffc5a5d57d896099a18cd1b80;p=thirdparty%2Fsamba.git lib: Update error check for new string conversion wrapper 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 Reviewed-by: Ralph Boehme Reviewed-by: Christof Schmitt --- diff --git a/source3/lib/interface.c b/source3/lib/interface.c index 342c92a61a2..31066b8b5cc 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -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)); diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index a0095d23978..1a27227fe41 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -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; }