Ubuntu Pastebin

Paste from Marco Trevisan (3v1n0) at Mon, 30 May 2016 14:24:21 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- ./gtk/gtkmenutracker.c
+++ ./gtk/gtkmenutracker.c (Unsaved)
@@ -244,7 +244,7 @@
 
   for (i = 0; i < n_items; i++)
     {
-      GtkMenuTrackerSection *subsection;
+      GtkMenuTrackerSection *subsection = NULL;
       gint n;
 
       if (*change_point)
@@ -337,10 +337,14 @@
    * of items within each item of the section before the change point).
    */
   change_point = &section->items;
-  for (i = 0; i < position; i++)
-    {
-      offset += gtk_menu_tracker_section_measure ((*change_point)->data);
-      change_point = &(*change_point)->next;
+
+  if (*change_point)
+    {
+      for (i = 0; i < position; i++)
+        {
+          offset += gtk_menu_tracker_section_measure ((*change_point)->data);
+          change_point = &(*change_point)->next;
+        }
     }
 
   /* We remove items in order and add items in reverse order.  This
Download as text