diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 602fe6d1df9..9d5f19cfbc0 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3447,7 +3447,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count) ioinfo *info = get_ioinfo(fd); HANDLE hand = info->handle; DWORD num_written, i; - BOOL console; + BOOL console = FALSE; if (hand == INVALID_HANDLE_VALUE || fd == MSVCRT_NO_CONSOLE_FD) { @@ -3482,7 +3482,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count) return num_written; } - console = MSVCRT__isatty(fd); + if (MSVCRT__isatty(fd)) console = VerifyConsoleIoHandle(hand); for (i = 0; i < count;) { const char *s = buf;