Module: wine Branch: master Commit: 7dfb21a9db18555666b24e5b1ad9324581c75af6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7dfb21a9db18555666b24e5b1a...
Author: Piotr Caban piotr@codeweavers.com Date: Wed Aug 10 17:18:02 2016 +0200
msvcrt: Fix parameters conversion in wcsftime function.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvcrt/time.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 50a27ec..e6e3eee 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1254,15 +1254,14 @@ MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
TRACE("%p %ld %s %p\n", str, max, debugstr_w(format), mstm );
- len = WideCharToMultiByte( CP_UNIXCP, 0, format, -1, NULL, 0, NULL, NULL ); + len = MSVCRT_wcstombs( NULL, format, 0 ) + 1; if (!(fmt = MSVCRT_malloc( len ))) return 0; - WideCharToMultiByte( CP_UNIXCP, 0, format, -1, fmt, len, NULL, NULL ); + MSVCRT_wcstombs(fmt, format, len);
if ((s = MSVCRT_malloc( max*4 ))) { if (!MSVCRT_strftime( s, max*4, fmt, mstm )) s[0] = 0; - len = MultiByteToWideChar( CP_UNIXCP, 0, s, -1, str, max ); - if (len) len--; + len = MSVCRT_mbstowcs( str, s, max ); MSVCRT_free( s ); } else len = 0;