Commit 46919f21 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

kernel32: Fixed copy-paste error in IdnToUnicode.

parent 280f8237
......@@ -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) {
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment