From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 718CA3858D39; Wed, 2 Mar 2022 02:16:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 718CA3858D39 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Fix a bug from comparison between int and DWORD. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/cygwin-3_3-branch X-Git-Oldrev: 13d2572373f01384eb5c6a841a4a31b5d5463834 X-Git-Newrev: c9f30df71885f92c96c1a673b1cc3e87ffcbbaf2 Message-Id: <20220302021645.718CA3858D39@sourceware.org> Date: Wed, 2 Mar 2022 02:16:45 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2022 02:16:45 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc9f30df7188= 5f92c96c1a673b1cc3e87ffcbbaf2 commit c9f30df71885f92c96c1a673b1cc3e87ffcbbaf2 Author: Takashi Yano Date: Wed Mar 2 11:08:27 2022 +0900 Cygwin: console: Fix a bug from comparison between int and DWORD. Diff: --- 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_con= sole.cc index 472485106..5840e5530 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1272,7 +1272,7 @@ out: { DWORD discarded; ReadConsoleInputW (get_handle (), input_rec, discard_len, &discarded= ); - con.num_processed =3D max (con.num_processed - discarded, 0); + con.num_processed -=3D min (con.num_processed, discarded); } return stat; }