1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

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>
This commit is contained in:
Swen Schillig 2019-03-06 09:43:53 +01:00 committed by Christof Schmitt
parent 1bdec2ce8c
commit c0c1004cd0

View File

@ -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;
}