mirror of
https://github.com/yawut/SDL.git
synced 2026-04-21 16:17:28 -05:00
Fixed bug in SDL_strcasecmp() with strings of different sizes
This commit is contained in:
parent
2269018714
commit
129f163eeb
|
|
@ -858,9 +858,13 @@ SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
|
|||
++str2;
|
||||
--maxlen;
|
||||
}
|
||||
a = SDL_tolower((unsigned char) *str1);
|
||||
b = SDL_tolower((unsigned char) *str2);
|
||||
return (int) ((unsigned char) a - (unsigned char) b);
|
||||
if (maxlen == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
a = SDL_tolower((unsigned char) *str1);
|
||||
b = SDL_tolower((unsigned char) *str2);
|
||||
return (int) ((unsigned char) a - (unsigned char) b);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user