diff mbox series

gtk: fix uninitialized variable

Message ID 20181003121138.22037-1-pbonzini@redhat.com
State New
Headers show
Series gtk: fix uninitialized variable | expand

Commit Message

Paolo Bonzini Oct. 3, 2018, 12:11 p.m. UTC
zoom_to_fit is never initialized to false, Coverity complains
(not sure why GCC does not).

Fixes: e8b1386ea1719525a1a92df03377764703fe8c64
Cc: kraxel@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 ui/gtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Oct. 3, 2018, 1:16 p.m. UTC | #1
On 03/10/2018 14:11, Paolo Bonzini wrote:
> zoom_to_fit is never initialized to false, Coverity complains
> (not sure why GCC does not).
> 
> Fixes: e8b1386ea1719525a1a92df03377764703fe8c64
> Cc: kraxel@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  ui/gtk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 3ddb5fe162..ec935fff90 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -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;
>
diff mbox series

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index 3ddb5fe162..ec935fff90 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -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;