mirror of
https://github.com/git/git.git
synced 2026-01-26 18:44:50 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user