Check for NULL as well as INVALID_HANDLE_VALUE

This commit is contained in:
Freddie Akeroyd
2021-02-23 01:09:50 +00:00
parent 7c55d7bdfa
commit ce4b14c611

View File

@ -56,7 +56,8 @@ static bool win_console_init() {
for(int i=0; i < sizeof(hCons) / sizeof(HANDLE); ++i)
{
DWORD dwMode = 0;
if (hCons[i] == INVALID_HANDLE_VALUE ||
if (hCons[i] == NULL ||
hCons[i] == INVALID_HANDLE_VALUE ||
!GetConsoleMode(hCons[i], &dwMode))
{
return false;