From 1b2370194636fbc25ebe6353bffd9a045787bfa1 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 27 Oct 2023 10:01:31 -0700 Subject: [PATCH] incorrect error check on GetStdHandle() Likely inconsequential as GetConsoleMode() should return 0 when given an invalid handle. --- modules/libcom/src/error/errlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/error/errlog.c b/modules/libcom/src/error/errlog.c index bd6d1c45d..2bd8d7676 100644 --- a/modules/libcom/src/error/errlog.c +++ b/modules/libcom/src/error/errlog.c @@ -247,7 +247,7 @@ int isATTY(FILE* fp) else if(fp==stderr) hand = GetStdHandle(STD_ERROR_HANDLE); #ifdef ENABLE_VIRTUAL_TERMINAL_PROCESSING - if(hand && GetConsoleMode(hand, &mode)) { + if(hand!=INVALID_HANDLE_VALUE && GetConsoleMode(hand, &mode)) { (void)SetConsoleMode(hand, mode|ENABLE_VIRTUAL_TERMINAL_PROCESSING); mode = 0u; if(GetConsoleMode(hand, &mode) && (mode&ENABLE_VIRTUAL_TERMINAL_PROCESSING))