fix ignored return value in getch_

This commit is contained in:
Lion Kortlepel 2022-09-26 12:24:27 +02:00
parent 3c4737a145
commit dbb01998ea
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -50,7 +50,9 @@ TEST_CASE("init and reset termios") {
static char getch_(int echo) { static char getch_(int echo) {
char ch; char ch;
initTermios(echo); initTermios(echo);
(void)read(STDIN_FILENO, &ch, 1); if (read(STDIN_FILENO, &ch, 1) < 0) {
// ignore, not much we can do
}
resetTermios(); resetTermios();
return ch; return ch;
} }