* [PATCH] Cygwin: console: Fix a bug from comparison between int and DWORD.
@ 2022-03-02 2:14 Takashi Yano
0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-03-02 2:14 UTC (permalink / raw)
To: cygwin-patches
---
winsup/cygwin/fhandler_console.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 7e51ea19e..7693ab8e4 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1274,7 +1274,7 @@ out:
{
DWORD discarded;
ReadConsoleInputW (get_handle (), input_rec, discard_len, &discarded);
- con.num_processed = max (con.num_processed - discarded, 0);
+ con.num_processed -= min (con.num_processed, discarded);
}
return stat;
}
--
2.35.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-02 2:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 2:14 [PATCH] Cygwin: console: Fix a bug from comparison between int and DWORD Takashi Yano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).