[PATCH 1/3] msvcrt: Improve tolower_l implementation

Alexandre Julliard julliard at winehq.org
Thu Mar 13 07:32:09 CDT 2014


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.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list