From 757d939728e83a79c224a000002ce8fbf39b9223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Bolvansk=C3=BD?= Date: Mon, 28 Mar 2022 19:05:16 +0200 Subject: [PATCH] Fixed windows build failure --- src/main.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index 7c77433a7..759fa2844 100644 --- a/src/main.c +++ b/src/main.c @@ -70,17 +70,19 @@ static void main_log (hashcat_ctx_t *hashcat_ctx, FILE *fp, const int loglevel) event_ctx->prev_len = msg_len; } + #if defined (_WIN) + HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE); + + CONSOLE_SCREEN_BUFFER_INFO con_info; + + GetConsoleScreenBufferInfo (hConsole, &con_info); + + const int orig = con_info.wAttributes; + #endif + // color stuff pre if (is_stdout_terminal()) { #if defined (_WIN) - HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE); - - CONSOLE_SCREEN_BUFFER_INFO con_info; - - GetConsoleScreenBufferInfo (hConsole, &con_info); - - const int orig = con_info.wAttributes; - switch (loglevel) { case LOGLEVEL_INFO: