diff options
author | Swen Schillig <swen@linux.ibm.com> | 2019-03-06 09:43:53 +0100 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2019-04-11 22:29:26 +0000 |
commit | c0c1004cd0946b9ead9b2441794dc9268af60fd8 (patch) | |
tree | 80bb2527bb852abfc5d84eb424f9d94e5d010387 /ctdb/protocol | |
parent | 1bdec2ce8c51edc5e23b87f43af14be443b61a84 (diff) | |
download | samba-c0c1004cd0946b9ead9b2441794dc9268af60fd8.tar.gz |
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 <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'ctdb/protocol')
-rw-r--r-- | ctdb/protocol/protocol_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |