Module: wine Branch: master Commit: 9ed740377ba0c88be0aebad82eef61c3f4df5940 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ed740377ba0c88be0aebad82e... Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jun 14 14:31:01 2015 +0200 msvcrt: Fix return value of _cputs. --- 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 d6bd40e..85fe7e0 100644 --- a/dlls/msvcrt/console.c +++ b/dlls/msvcrt/console.c @@ -69,11 +69,14 @@ void msvcrt_free_console(void) int CDECL _cputs(const char* str) { DWORD count; - int retval = MSVCRT_EOF; + int len, retval = -1; + + if (!MSVCRT_CHECK_PMT(str != NULL)) return -1; + len = strlen(str); LOCK_CONSOLE; - if (WriteConsoleA(MSVCRT_console_out, str, strlen(str), &count, NULL) - && count == 1) + if (WriteConsoleA(MSVCRT_console_out, str, len, &count, NULL) + && count == len) retval = 0; UNLOCK_CONSOLE; return retval;