Fixed bug in SDL_strcasecmp() with strings of different sizes
This commit is contained in:
parent
f1d2b88a2f
commit
acdd875c64
1 changed files with 7 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue