summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-09-07 00:13:03 +0200
committerWim Taymans <wim.taymans@gmail.com>2020-09-07 15:10:29 +0000
commit8332ee0c252882099a3efff4c49ea246b59b623b (patch)
treeaf595c758e31d745ae9278efdeb42cab32c134e9
parent0d1b01147f8f4bb88abd4138354368131bcd731f (diff)
spa: replace rindex() with strrchr()
Linux man-page says rindex() got “marked as LEGACY in POSIX.1-2001, [and removed in] POSIX.1-2008”.
-rw-r--r--spa/include/spa/debug/types.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/spa/include/spa/debug/types.h b/spa/include/spa/debug/types.h
index 12bfb493..8b75d2c7 100644
--- a/spa/include/spa/debug/types.h
+++ b/spa/include/spa/debug/types.h
@@ -31,6 +31,8 @@ extern "C" {
#include <spa/utils/type-info.h>
+#include <string.h>
+
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;
}