From 46919f21544fce02e3a90ecfcc0f2f3e79972932 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 28 Mar 2013 16:10:44 +0100 Subject: [PATCH] kernel32: Fixed copy-paste error in IdnToUnicode. --- dlls/kernel32/locale.c | 6 +++--- dlls/kernel32/tests/locale.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 57daab1ce1..04fb6e8b26 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -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) { diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index e9c83b8cc9..f1c66e2f90 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -3386,6 +3386,10 @@ static void test_IdnToUnicode(void) for (i=0; i