From nobody Sun Nov 16 04:16:00 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1743652485; cv=none; d=zohomail.com; s=zohoarc; b=YOCsLS1LAU4FRIQKrCkxG05NzsTRWyfw5DDL+QSDHrm647Rxgsi6G8G5OnpQCKlQy8cJSbTtyRsehnJJbXTZqJgER2p25pepjAGPLYyEFIHtjWhZVMOjRm8n87GVQvU5nNucLIpfsYq8S7lvfaAy4K1YyQNf0BHxqCOSDIqOVkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743652485; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id:Cc; bh=IuIxDV9ZU7dW/T6L0RPb9jN3ZKTUoLiK+7IPUZdw5nQ=; b=OAsuSCjS/k0SP+P5ZNHZ3f6L7WXGWlTyuH8DTP28xE8kphro3o93bTYiEUmxU/5QX8Tw2ZPqwK4k+/6MipMrHVuegyWBBEx+81qI+BdYEFM5qGYODwHs1ut64329CJc4qRpV1PB8PU/wUkXPDHKXdXVp2lWPwoBrw3ND/upgcs4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1743652485412284.488711627592; Wed, 2 Apr 2025 20:54:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0BeN-0000Ox-NP; Wed, 02 Apr 2025 23:53:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u0947-0000pD-BK for qemu-devel@nongnu.org; Wed, 02 Apr 2025 21:08:20 -0400 Received: from mail-0201.mail-europe.com ([51.77.79.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u0943-0007hM-Fp for qemu-devel@nongnu.org; Wed, 02 Apr 2025 21:08:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1743642481; x=1743901681; bh=IuIxDV9ZU7dW/T6L0RPb9jN3ZKTUoLiK+7IPUZdw5nQ=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=ZF2s1+Z20pXQJts5nSu8B1lzn+3SdIAa9OPvFXWIH2aljAClqffMOmRCn0motMxnu VhaS+LRJ2cWAzgcj4J/Lo/xI5PfSsFfScyQhcvMGWUXt4umzdI3olq6jlvFUzlS+iD rnprVEkyGvgM/g5Z+3QSAXWROBu3bEXZeIdHYi3BXzoeR0eP0rqDOpWcpUMOx5CcTY IuWo+SahrNb6eZS0Ku3jbpQFaBiGUSwP8al3ZObvZGcxHdcEAiRbZ0vUNKij0xdExX qEjw0b7emIZUjnrZ51HRpIytaV+jyhPBwl6UNUFBv7flhcaV4SK9j9iInnAynj/dHC df+dNdrUNhF1g== Date: Thu, 03 Apr 2025 01:07:56 +0000 To: "qemu-devel@nongnu.org" Subject: [PATCH] ui/curses: Fix infinite loop on windows Message-ID: Feedback-ID: 51238035:user:proton X-Pm-Message-ID: 1a0ed4ef1e55ba72f73976a7ad9b638932a48003 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=51.77.79.158; envelope-from=purplearmadillo77@proton.me; helo=mail-0201.mail-europe.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 02 Apr 2025 23:53:52 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: William Hu From: William Hu via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1743652488386019000 Content-Type: text/plain; charset="utf-8" From a42046272f0544dd18ed58661e53ea17d1584c2c Mon Sep 17 00:00:00 2001 From: William Hu Date: Wed, 2 Apr 2025 12:00:00 -0400 Subject: [PATCH] ui/curses: Fix infinite loop on windows Replace -1 comparisons for wint_t with WEOF to fix infinite loop caused by a 65535 =3D=3D -1 comparison. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2905 Signed-off-by: William Hu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- ui/curses.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index a39aee8762..3f5c5adf78 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -265,7 +265,12 @@ static int curses2foo(const int _curses2foo[], const i= nt _curseskey2foo[], =20 static void curses_refresh(DisplayChangeListener *dcl) { - int chr, keysym, keycode, keycode_alt; + /* + * DO NOT MAKE chr AN INT: + * Causes silent conversion errors on Windows where wint_t is unsigned= short. + */ + wint_t chr =3D 0; + int keysym, keycode, keycode_alt; enum maybe_keycode maybe_keycode =3D CURSES_KEYCODE; =20 curses_winch_check(); @@ -284,8 +289,9 @@ static void curses_refresh(DisplayChangeListener *dcl) /* while there are any pending key strokes to process */ chr =3D console_getch(&maybe_keycode); =20 - if (chr =3D=3D -1) + if (chr =3D=3D WEOF) { break; + } =20 #ifdef KEY_RESIZE /* this shouldn't occur when we use a custom SIGWINCH handler */ --=20 2.47.0