1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-protocol: rindex->strrchr

According to "man rindex" on debian bullseye rindex() was deprecated
in Posix.1-2001 and removed from Posix.1-2008.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Volker Lendecke 2021-12-29 15:10:28 +01:00
parent 8c0391d38e
commit baaedd69b3

View File

@ -230,10 +230,10 @@ static int ip_from_string(const char *str, ctdb_sock_addr *addr)
/* IPv4 or IPv6 address?
*
* Use rindex() because we need the right-most ':' below for
* Use strrchr() because we need the right-most ':' below for
* IPv4-mapped IPv6 addresses anyway...
*/
p = rindex(str, ':');
p = strrchr(str, ':');
if (p == NULL) {
ret = ipv4_from_string(str, &addr->ip);
} else {
@ -286,7 +286,7 @@ int ctdb_sock_addr_from_string(const char *str,
return EINVAL;
}
p = rindex(s, ':');
p = strrchr(s, ':');
if (p == NULL) {
return EINVAL;
}
@ -324,7 +324,7 @@ int ctdb_sock_addr_mask_from_string(const char *str,
return EINVAL;
}
p = rindex(s, '/');
p = strrchr(s, '/');
if (p == NULL) {
return EINVAL;
}