From nobody Thu May 2 23:58:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552659352659864.6867059424578; Fri, 15 Mar 2019 07:15:52 -0700 (PDT) Received: from localhost ([127.0.0.1]:55904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4nch-0003rs-FM for importer@patchew.org; Fri, 15 Mar 2019 10:15:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4mai-0000a5-NF for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4mah-0003wK-Cs for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:40 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:51308) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4mag-0003tr-GI for qemu-devel@nongnu.org; Fri, 15 Mar 2019 09:09:39 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id CB9A3E139; Fri, 15 Mar 2019 14:09:35 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SgIm4B-soarT; Fri, 15 Mar 2019 14:09:34 +0100 (CET) Received: from function (dhcp-64-88.ens-lyon.fr [140.77.64.88]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6F890E142; Fri, 15 Mar 2019 14:09:34 +0100 (CET) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1h4mab-0006nt-IW; Fri, 15 Mar 2019 14:09:33 +0100 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org Date: Fri, 15 Mar 2019 14:09:32 +0100 Message-Id: <20190315130932.26094-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PATCHv2] curses ui: always initialize all curses_line fields X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , kraxel@redhat.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" cchar_t can contain not only attr and chars fields, but also ext_color. Initialize the whole structure to zero instead of enumerating fields. Spotted by Coverity: CID 1399711 Signed-off-by: Samuel Thibault Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- ui/curses.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index d29098db9f..cc6d6da684 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -75,9 +75,9 @@ static void curses_update(DisplayChangeListener *dcl, if (vga_to_curses[ch].chars[0]) { curses_line[x] =3D vga_to_curses[ch]; } else { - curses_line[x].chars[0] =3D ch; - curses_line[x].chars[1] =3D 0; - curses_line[x].attr =3D 0; + curses_line[x] =3D (cchar_t) { + .chars[0] =3D ch, + }; } curses_line[x].attr |=3D at; } --=20 2.20.1