Piotr Caban : msvcrt: Fix parameters conversion in wcsftime function.
Alexandre Julliard
julliard at winehq.org
Thu Aug 11 09:37:47 CDT 2016
Module: wine
Branch: master
Commit: 7dfb21a9db18555666b24e5b1ad9324581c75af6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7dfb21a9db18555666b24e5b1ad9324581c75af6
Author: Piotr Caban <piotr at codeweavers.com>
Date: Wed Aug 10 17:18:02 2016 +0200
msvcrt: Fix parameters conversion in wcsftime function.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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;
More information about the wine-cvs
mailing list