]> Git Repo - qemu.git/commitdiff
curses ui: always initialize all curses_line fields
authorSamuel Thibault <[email protected]>
Fri, 15 Mar 2019 13:09:32 +0000 (14:09 +0100)
committerGerd Hoffmann <[email protected]>
Mon, 18 Mar 2019 09:54:05 +0000 (10:54 +0100)
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 <[email protected]>
Message-Id: <20190315130932[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
ui/curses.c

index 3a7e8649f3decaa39257fefdd817b5129b456328..4ef9b9c677ce5dd504e5ce4aa222533075d2fdc9 100644 (file)
@@ -75,9 +75,9 @@ static void curses_update(DisplayChangeListener *dcl,
             if (vga_to_curses[ch].chars[0]) {
                 curses_line[x] = vga_to_curses[ch];
             } else {
-                curses_line[x].chars[0] = ch;
-                curses_line[x].chars[1] = 0;
-                curses_line[x].attr = 0;
+                curses_line[x] = (cchar_t) {
+                    .chars[0] = ch,
+                };
             }
             curses_line[x].attr |= at;
         }
This page took 0.023403 seconds and 4 git commands to generate.