[2/2] msvcrt: Forward strftime() to wcsftime(). Take 2.

Alexandre Julliard julliard at winehq.org
Tue Jan 10 11:02:08 CST 2012


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> +    len = MultiByteToWideChar( CP_ACP, 0, format, -1, NULL, 0 );
> +    if ((fmt = MSVCRT_malloc( len * sizeof(MSVCRT_wchar_t) )))
> +    {
> +        MultiByteToWideChar( CP_ACP, 0, format, -1, fmt, len );
> +
> +        if ((len = MSVCRT_wcsftime( s, max, fmt, mstm )))
> +        {
> +            len = WideCharToMultiByte( CP_ACP, 0, s, len, str, max, NULL, NULL );
> +            if (len < max) str[len] = 0;
> +        }

The overflow handling still looks suspicious. It probably needs some
more test cases.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list