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 <samuel.thiba...@ens-lyon.org>
---
 ui/curses.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ui/curses.c b/ui/curses.c
index d29098db9f..e99fbe3e24 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -75,9 +75,8 @@ static void curses_update(DisplayChangeListener *dcl,
             if (vga_to_curses[ch].chars[0]) {
                 curses_line[x] = vga_to_curses[ch];
             } else {
+                curses_line[x] = (cchar_t) {};
                 curses_line[x].chars[0] = ch;
-                curses_line[x].chars[1] = 0;
-                curses_line[x].attr = 0;
             }
             curses_line[x].attr |= at;
         }
-- 
2.20.1


Reply via email to