[PATCH 1/3] msvcrt: Improve tolower_l implementation

Piotr Caban piotr at codeweavers.com
Thu Mar 13 07:45:09 CDT 2014


On 03/13/14 13:32, Alexandre Julliard wrote:
> Piotr Caban <piotr at 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.



More information about the wine-devel mailing list