mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
spa: replace rindex() with strrchr()
Linux man-page says rindex() got “marked as LEGACY in POSIX.1-2001, [and removed in] POSIX.1-2008”.
This commit is contained in:
parent
0d1b01147f
commit
8332ee0c25
1 changed files with 3 additions and 1 deletions
|
|
@ -31,6 +31,8 @@ extern "C" {
|
||||||
|
|
||||||
#include <spa/utils/type-info.h>
|
#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)
|
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;
|
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)
|
static inline const char *spa_debug_type_short_name(const char *name)
|
||||||
{
|
{
|
||||||
const char *h;
|
const char *h;
|
||||||
if ((h = rindex(name, ':')) != NULL)
|
if ((h = strrchr(name, ':')) != NULL)
|
||||||
name = h + 1;
|
name = h + 1;
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue