From: Swen Schillig Date: Wed, 6 Mar 2019 08:43:53 +0000 (+0100) Subject: ctdb-protocol: Update error check for new string conversion wrapper X-Git-Tag: tdb-1.4.1~453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0c1004cd0946b9ead9b2441794dc9268af60fd8;p=thirdparty%2Fsamba.git ctdb-protocol: 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/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c index f97c64665df..d120213b70a 100644 --- a/ctdb/protocol/protocol_util.c +++ b/ctdb/protocol/protocol_util.c @@ -291,7 +291,7 @@ int ctdb_sock_addr_from_string(const char *str, } port = strtoul_err(p+1, &endp, 10, &ret); - if (endp == p+1 || *endp != '\0' || ret != 0) { + if (ret != 0 || *endp != '\0') { /* Empty string or trailing garbage */ return EINVAL; } @@ -330,7 +330,7 @@ int ctdb_sock_addr_mask_from_string(const char *str, } m = strtoul_err(p+1, &endp, 10, &ret); - if (endp == p+1 || *endp != '\0' || ret != 0) { + if (ret != 0 || *endp != '\0') { /* Empty string or trailing garbage */ return EINVAL; }