From 8332ee0c252882099a3efff4c49ea246b59b623b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 7 Sep 2020 00:13:03 +0200 Subject: [PATCH] spa: replace rindex() with strrchr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux man-page says rindex() got “marked as LEGACY in POSIX.1-2001, [and removed in] POSIX.1-2008”. --- spa/include/spa/debug/types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/include/spa/debug/types.h b/spa/include/spa/debug/types.h index 12bfb493e..8b75d2c7f 100644 --- a/spa/include/spa/debug/types.h +++ b/spa/include/spa/debug/types.h @@ -31,6 +31,8 @@ extern "C" { #include +#include + static inline const struct spa_type_info *spa_debug_type_find(const struct spa_type_info *info, uint32_t type) { const struct spa_type_info *res; @@ -53,7 +55,7 @@ static inline const struct spa_type_info *spa_debug_type_find(const struct spa_t static inline const char *spa_debug_type_short_name(const char *name) { const char *h; - if ((h = rindex(name, ':')) != NULL) + if ((h = strrchr(name, ':')) != NULL) name = h + 1; return name; }