mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
Add SDL_strpbrk
This commit is contained in:

committed by
Anonymous Maarten

parent
55934bc85e
commit
baa1a5e2f4
@@ -2401,3 +2401,22 @@ int SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char * SDL_strpbrk(const char *str, const char *breakset)
|
||||
{
|
||||
#ifdef HAVE_STRPBRK
|
||||
return strpbrk(str, breakset);
|
||||
#else
|
||||
|
||||
for (; *str; str++) {
|
||||
const char *b;
|
||||
|
||||
for (b = breakset; *b; b++) {
|
||||
if (*str == *b) {
|
||||
return (char *) str;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user