Skip to contentSkip to conversation

gtk: fix uninitialized variable

PATCH In review Paolo Bonzini 2 participants 2 messages Oct 3, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtk: fix uninitialized variable

zoom_to_fit is never initialized to false, Coverity complains (not sure why GCC does not).

Fixes e8b1386ea1719525a1a92df03377764703fe8c64
---
 ui/gtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/gtk.c +1 -1
index 3ddb5fe162..ec935fff90 100644
@@ -2136,7 +2136,7 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
                               QemuConsole *con, int idx,
                               GSList *group, GtkWidget *view_menu)
 {
-    bool zoom_to_fit;
+    bool zoom_to_fit = false;
 
     vc->label = qemu_console_get_label(con);
     vc->s = s;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Paolo Bonzini

zoom_to_fit is never initialized to false, Coverity complains (not sure why GCC does not).

Fixes e8b1386ea1719525a1a92df03377764703fe8c64
Quoted 18 lines
---
 ui/gtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/gtk.c +1 -1
index 3ddb5fe162..ec935fff90 100644
@@ -2136,7 +2136,7 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
                               QemuConsole *con, int idx,
                               GSList *group, GtkWidget *view_menu)
 {
-    bool zoom_to_fit;
+    bool zoom_to_fit = false;
 
     vc->label = qemu_console_get_label(con);
     vc->s = s;