From: Volker Lendecke Date: Wed, 29 Dec 2021 14:10:28 +0000 (+0100) Subject: ctdb-protocol: rindex->strrchr X-Git-Tag: tdb-1.4.6~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baaedd69b3e02cdef06353bd5a21a5c5e6079604;p=thirdparty%2Fsamba.git 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 Reviewed-by: Martin Schwenke --- diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c index 2d0a6f33038..1f1d874167a 100644 --- a/ctdb/protocol/protocol_util.c +++ b/ctdb/protocol/protocol_util.c @@ -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; }