mirror of https://github.com/encounter/SDL.git
Merge commit '51f75b8b309992252a1e18643e310f2774dec4ef' into main
This commit is contained in:
commit
8db084d5e7
|
@ -695,6 +695,9 @@ SDL_strchr(const char *string, int c)
|
||||||
}
|
}
|
||||||
++string;
|
++string;
|
||||||
}
|
}
|
||||||
|
if (c == '\0') {
|
||||||
|
return (char *) string;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif /* HAVE_STRCHR */
|
#endif /* HAVE_STRCHR */
|
||||||
}
|
}
|
||||||
|
@ -707,7 +710,7 @@ SDL_strrchr(const char *string, int c)
|
||||||
#elif defined(HAVE_RINDEX)
|
#elif defined(HAVE_RINDEX)
|
||||||
return SDL_const_cast(char*,rindex(string, c));
|
return SDL_const_cast(char*,rindex(string, c));
|
||||||
#else
|
#else
|
||||||
const char *bufp = string + SDL_strlen(string) - 1;
|
const char *bufp = string + SDL_strlen(string);
|
||||||
while (bufp >= string) {
|
while (bufp >= string) {
|
||||||
if (*bufp == c) {
|
if (*bufp == c) {
|
||||||
return (char *) bufp;
|
return (char *) bufp;
|
||||||
|
|
Loading…
Reference in New Issue