Piotr Caban : msvcrt: Fix _putws implementation.
Alexandre Julliard
julliard at winehq.org
Mon Apr 20 15:01:48 CDT 2020
Module: wine
Branch: oldstable
Commit: bf8638c41b87472d39893a9f53ba2e5ddeee5690
URL: https://source.winehq.org/git/wine.git/?a=commit;h=bf8638c41b87472d39893a9f53ba2e5ddeee5690
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Sep 30 15:22:15 2019 +0200
msvcrt: Fix _putws implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47615
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 3577f06f719e854513d1015f33aa78c506ad3f32)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/msvcrt/file.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index e06bb0076d..1a1945f879 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -4834,19 +4834,14 @@ int CDECL MSVCRT_puts(const char *s)
*/
int CDECL MSVCRT__putws(const MSVCRT_wchar_t *s)
{
- static const MSVCRT_wchar_t nl = '\n';
- MSVCRT_size_t len = strlenW(s);
int ret;
MSVCRT__lock_file(MSVCRT_stdout);
- if(MSVCRT__fwrite_nolock(s, sizeof(*s), len, MSVCRT_stdout) != len) {
- MSVCRT__unlock_file(MSVCRT_stdout);
- return MSVCRT_EOF;
- }
-
- ret = MSVCRT__fwrite_nolock(&nl,sizeof(nl),1,MSVCRT_stdout) == 1 ? 0 : MSVCRT_EOF;
+ ret = MSVCRT_fputws(s, MSVCRT_stdout);
+ if(ret >= 0)
+ ret = MSVCRT__fputwc_nolock('\n', MSVCRT_stdout);
MSVCRT__unlock_file(MSVCRT_stdout);
- return ret;
+ return ret >= 0 ? 0 : MSVCRT_WEOF;
}
/*********************************************************************
More information about the wine-cvs
mailing list