Merge commit '51f75b8b309992252a1e18643e310f2774dec4ef' into main

This commit is contained in:
Sam Lantinga 2022-07-05 21:41:24 -07:00
commit 8db084d5e7
1 changed files with 4 additions and 1 deletions

View File

@ -695,6 +695,9 @@ SDL_strchr(const char *string, int c)
}
++string;
}
if (c == '\0') {
return (char *) string;
}
return NULL;
#endif /* HAVE_STRCHR */
}
@ -707,7 +710,7 @@ SDL_strrchr(const char *string, int c)
#elif defined(HAVE_RINDEX)
return SDL_const_cast(char*,rindex(string, c));
#else
const char *bufp = string + SDL_strlen(string) - 1;
const char *bufp = string + SDL_strlen(string);
while (bufp >= string) {
if (*bufp == c) {
return (char *) bufp;