[gtk+/gtk-3-22] box: Initialize size arrays to 0



commit f3f71ef0ac49612912b91f700fa011d79ddb3488
Author: Timm Bäder <mail baedert org>
Date:   Thu Mar 30 07:02:00 2017 +0000

    box: Initialize size arrays to 0
    
    Thats the right thing to do.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773814

 gtk/gtkbox.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index e034be8..1e9f18d 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -521,6 +521,7 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
 
   direction = gtk_widget_get_direction (widget);
   sizes = g_newa (GtkRequestedSize, nvis_children);
+  memset (sizes, 0, nvis_children * sizeof (GtkRequestedSize));
 
   if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
     size = allocation->width - (nvis_children - 1) * private->spacing;
@@ -1220,7 +1221,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
                            allocation,
                            gtk_widget_get_allocated_baseline (widget),
                            &clip);
-  
+
   gtk_widget_set_clip (widget, &clip);
 }
 
@@ -1763,6 +1764,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
     return;
 
   sizes = g_newa (GtkRequestedSize, nvis_children);
+  memset (sizes, 0, nvis_children * sizeof (GtkRequestedSize));
   size = avail_size - (nvis_children - 1) * private->spacing;
 
   /* Retrieve desired size for visible children */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]