Re: [PATCH 1/3] msvcrt: Improve tolower_l implementation
Piotr Caban <piotr(a)codeweavers.com> writes:
+ if(!MultiByteToWideChar(locinfo->lc_codepage, + MB_ERR_INVALID_CHARS, (char*)str, p-str, &wide, 1)) + return c; + + lower = tolowerW(wide); + if(lower == wide) + return str[0] + (str[1]<<8); + + WideCharToMultiByte(locinfo->lc_codepage, 0, + &lower, 1, (char*)str, 2, NULL, NULL);
You should probably also check the resulting length here. -- Alexandre Julliard julliard(a)winehq.org
On 03/13/14 13:32, Alexandre Julliard wrote:
Piotr Caban <piotr(a)codeweavers.com> writes:
+ if(!MultiByteToWideChar(locinfo->lc_codepage, + MB_ERR_INVALID_CHARS, (char*)str, p-str, &wide, 1)) + return c; + + lower = tolowerW(wide); + if(lower == wide) + return str[0] + (str[1]<<8); + + WideCharToMultiByte(locinfo->lc_codepage, 0, + &lower, 1, (char*)str, 2, NULL, NULL);
You should probably also check the resulting length here.
I've sent a fixed version. Thanks.
participants (2)
-
Alexandre Julliard -
Piotr Caban