Skip to content

Commit

Permalink
Merge win32 ReadConsoleW fix from mjunix/patch-1
Browse files Browse the repository at this point in the history
Fix argument to ReadConsoleW (Takes number of characters instead of bytes)
  • Loading branch information
LekKit authored Dec 3, 2022
2 parents d76a2e3 + 5c95b12 commit 4041c0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices/ns16550a.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static uint8_t terminal_readchar(void* addr)
if (t_head == t_tail && _kbhit()) {
wchar_t w_buff[8];
DWORD w_chars;
ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), w_buff, sizeof(w_buff), &w_chars, NULL);
ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), w_buff, ARRAYSIZE(w_buff), &w_chars, NULL);
t_head = WideCharToMultiByte(CP_UTF8, 0, w_buff, w_chars, t_buff, sizeof(t_buff), NULL, NULL);
t_tail = 0;
}
Expand Down

0 comments on commit 4041c0b

Please sign in to comment.