msvcrt: Fix _stricmp behavior on characters that doesn't fit into signed char.

This commit is contained in:
Piotr Caban 2014-09-03 14:43:02 +02:00 committed by Alexandre Julliard
parent 7c3364621f
commit 7cf23a7957
2 changed files with 3 additions and 1 deletions

View File

@ -1766,7 +1766,7 @@ int __cdecl MSVCRT__strnicmp_l(const char *s1, const char *s2,
MSVCRT_size_t count, MSVCRT__locale_t locale) MSVCRT_size_t count, MSVCRT__locale_t locale)
{ {
MSVCRT_pthreadlocinfo locinfo; MSVCRT_pthreadlocinfo locinfo;
char c1, c2; int c1, c2;
if(s1==NULL || s2==NULL) if(s1==NULL || s2==NULL)
return MSVCRT__NLSCMPERROR; return MSVCRT__NLSCMPERROR;

View File

@ -2548,6 +2548,8 @@ static void test__stricmp(void)
ok(ret > 0, "_stricmp returned %d\n", ret); ok(ret > 0, "_stricmp returned %d\n", ret);
ret = _stricmp("\xa5", "\xb9"); ret = _stricmp("\xa5", "\xb9");
ok(ret == 0, "_stricmp returned %d\n", ret); ok(ret == 0, "_stricmp returned %d\n", ret);
ret = _stricmp("a", "\xb9");
ok(ret < 0, "_stricmp returned %d\n", ret);
setlocale(LC_ALL, "C"); setlocale(LC_ALL, "C");
} }