kernel32: Fixed copy-paste error in IdnToUnicode.

This commit is contained in:
Piotr Caban 2013-03-28 16:10:44 +01:00 committed by Alexandre Julliard
parent 280f8237b5
commit 46919f2154
2 changed files with 7 additions and 3 deletions

View File

@ -4480,8 +4480,8 @@ INT WINAPI IdnToUnicode(DWORD dwFlags, LPCWSTR lpASCIICharStr, INT cchASCIIChar,
return 0;
}
if((dwFlags&IDN_USE_STD3_ASCII_RULES) && (lpUnicodeCharStr[label_start]=='-' ||
lpUnicodeCharStr[label_end-1]=='-')) {
if((dwFlags&IDN_USE_STD3_ASCII_RULES) && (lpASCIICharStr[label_start]=='-' ||
lpASCIICharStr[label_end-1]=='-')) {
SetLastError(ERROR_INVALID_NAME);
return 0;
}
@ -4494,7 +4494,7 @@ INT WINAPI IdnToUnicode(DWORD dwFlags, LPCWSTR lpASCIICharStr, INT cchASCIIChar,
tolowerW(lpASCIICharStr[label_start])!='x' ||
tolowerW(lpASCIICharStr[label_start+1])!='n' ||
lpASCIICharStr[label_start+2]!='-' || lpASCIICharStr[label_start+3]!='-') {
if(label_end < cchUnicodeChar)
if(label_end < cchASCIIChar)
label_end++;
if(!lpUnicodeCharStr) {

View File

@ -3386,6 +3386,10 @@ static void test_IdnToUnicode(void)
for (i=0; i<sizeof(test_data)/sizeof(*test_data); i++)
{
ret = pIdnToUnicode(test_data[i].flags, test_data[i].in,
test_data[i].in_len, NULL, 0);
ok(ret == test_data[i].ret, "%d) ret = %d\n", i, ret);
SetLastError(0xdeadbeef);
ret = pIdnToUnicode(test_data[i].flags, test_data[i].in,
test_data[i].in_len, buf, sizeof(buf));