From ef07c705c6cd54841c704c1c22489d4f4fe7baf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Tue, 31 Dec 2024 16:47:05 -0500 Subject: [PATCH] Explicitly use the "ANSI" console read/write functions. Where we use the AsciiChar memory of the returned struct. --- src/conio/win32cio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conio/win32cio.c b/src/conio/win32cio.c index 866454aebe..0f9330ff4b 100644 --- a/src/conio/win32cio.c +++ b/src/conio/win32cio.c @@ -268,7 +268,7 @@ static int win32_keyboardio(int isgetch) if(lastch) continue; - if(!ReadConsoleInput(h, &input, 1, &num) + if(!ReadConsoleInputA(h, &input, 1, &num) || !num || (input.EventType!=KEY_EVENT && input.EventType!=MOUSE_EVENT && input.EventType != WINDOW_BUFFER_SIZE_EVENT)) continue; @@ -827,7 +827,7 @@ int win32_gettext(int left, int top, int right, int bottom, void* buf) ci=(CHAR_INFO *)alloca(sizeof(CHAR_INFO)*(bs.X*bs.Y)); if((h=GetStdHandle(STD_OUTPUT_HANDLE)) == INVALID_HANDLE_VALUE) return 0; // failure - ReadConsoleOutput(h,ci,bs,bc,®); + ReadConsoleOutputA(h,ci,bs,bc,®); for(y=0;y<=(bottom-top);y++) { for(x=0;x<=(right-left);x++) { bu[((y*bs.X)+x)*2]=ci[(y*bs.X)+x].Char.AsciiChar; @@ -887,7 +887,7 @@ int win32_puttext(int left, int top, int right, int bottom, void* buf) } } if((h=GetStdHandle(STD_OUTPUT_HANDLE)) != INVALID_HANDLE_VALUE) - WriteConsoleOutput(h,ci,bs,bc,®); + WriteConsoleOutputA(h,ci,bs,bc,®); return 1; } -- GitLab