[Win] Fixed usage of ReadConsoleInput (#74)

ReadConsoleInput params: |nLength| is the size in array elements, not in byte.

Co-authored-by: d <d>
This commit is contained in:
jdfa 2021-03-13 22:02:01 +02:00 committed by GitHub
parent d48e3decfc
commit 9cc3779145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ void EventListener(std::atomic<bool>* quit,
std::vector<INPUT_RECORD> records{number_of_events};
DWORD number_of_events_read = 0;
ReadConsoleInput(console, records.data(),
(DWORD)(records.size() * sizeof(INPUT_RECORD)),
(DWORD)records.size(),
&number_of_events_read);
records.resize(number_of_events_read);