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;
|
++str2;
|
||||||
--maxlen;
|
--maxlen;
|
||||||
}
|
}
|
||||||
a = SDL_tolower((unsigned char) *str1);
|
if (maxlen == 0) {
|
||||||
b = SDL_tolower((unsigned char) *str2);
|
return 0;
|
||||||
return (int) ((unsigned char) a - (unsigned char) b);
|
} else {
|
||||||
|
a = SDL_tolower((unsigned char) *str1);
|
||||||
|
b = SDL_tolower((unsigned char) *str2);
|
||||||
|
return (int) ((unsigned char) a - (unsigned char) b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue