Piotr Caban : msvcrt: Fix return value of cputws.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 15 08:49:08 CDT 2015


Module: wine
Branch: master
Commit: de68efdb7d69e03a91db8b61c33f3465bd324ade
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=de68efdb7d69e03a91db8b61c33f3465bd324ade

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Sun Jun 14 14:31:08 2015 +0200

msvcrt: Fix return value of cputws.

---

 dlls/msvcrt/console.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/console.c b/dlls/msvcrt/console.c
index 85fe7e0..e8eea7f 100644
--- a/dlls/msvcrt/console.c
+++ b/dlls/msvcrt/console.c
@@ -88,11 +88,14 @@ int CDECL _cputs(const char* str)
 int CDECL _cputws(const MSVCRT_wchar_t* str)
 {
   DWORD count;
-  int retval = MSVCRT_EOF;
+  int len, retval = -1;
+
+  if (!MSVCRT_CHECK_PMT(str != NULL)) return -1;
+  len = lstrlenW(str);
 
   LOCK_CONSOLE;
-  if (WriteConsoleW(MSVCRT_console_out, str, lstrlenW(str), &count, NULL)
-      && count == 1)
+  if (WriteConsoleW(MSVCRT_console_out, str, len, &count, NULL)
+      && count == len)
     retval = 0;
   UNLOCK_CONSOLE;
   return retval;




More information about the wine-cvs mailing list