winansi: avoid use of uninitialized value

When stdout is not connected to a Win32 console, we incorrectly used an
uninitialized value for the "plain" character attributes.

Detected by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2017-04-17 12:17:17 +02:00
parent edffb73b20
commit 2c9bc7ed8d

View File

@@ -100,6 +100,8 @@ static int is_console(int fd)
if (!fd) {
if (!GetConsoleMode(hcon, &mode))
return 0;
sbi.wAttributes = FOREGROUND_BLUE | FOREGROUND_GREEN |
FOREGROUND_RED;
} else if (!GetConsoleScreenBufferInfo(hcon, &sbi))
return 0;