diff options
author | 2009-06-25 08:04:39 +0000 | |
---|---|---|
committer | 2009-06-25 08:04:39 +0000 | |
commit | e692918b34b127e3be7ef00fd470c90ff8adb3ca (patch) | |
tree | 392424f5045e66e50a96a5f7e4b217da870dcf69 /src/lib/util/corestr.c | |
parent | f7ce2a786aaa4ac5e9f82daa4b78ee89ca5ef46c (diff) |
Added casts to ensure proper values are passed to the ctype.h functions.
[Juergen Buchmueller]
Diffstat (limited to 'src/lib/util/corestr.c')
-rw-r--r-- | src/lib/util/corestr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/util/corestr.c b/src/lib/util/corestr.c index c30c7b453ce..2a8c502163e 100644 --- a/src/lib/util/corestr.c +++ b/src/lib/util/corestr.c @@ -10,6 +10,7 @@ ****************************************************************************/ #include "corestr.h" +#include "osdcore.h" #include <ctype.h> #include <stdlib.h> @@ -22,8 +23,8 @@ int core_stricmp(const char *s1, const char *s2) { for (;;) { - int c1 = tolower(*s1++); - int c2 = tolower(*s2++); + int c1 = tolower((UINT8)*s1++); + int c2 = tolower((UINT8)*s2++); if (c1 == 0 || c1 != c2) return c1 - c2; } @@ -39,8 +40,8 @@ int core_strnicmp(const char *s1, const char *s2, size_t n) size_t i; for (i = 0; i < n; i++) { - int c1 = tolower(*s1++); - int c2 = tolower(*s2++); + int c1 = tolower((UINT8)*s1++); + int c2 = tolower((UINT8)*s2++); if (c1 == 0 || c1 != c2) return c1 - c2; } |