[gtk+] Added return_if_fail guard to gtk_distribute_natural_allocation()



commit 8c14bf009d4141a606735ac64dace9b30d9c915c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Aug 18 19:31:53 2010 -0400

    Added return_if_fail guard to gtk_distribute_natural_allocation()

 gtk/gtksizerequest.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 81c66f6..908cc39 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -584,6 +584,8 @@ gtk_distribute_natural_allocation (gint              extra_space,
   guint *spreading = g_newa (guint, n_requested_sizes);
   gint   i;
 
+  g_return_val_if_fail (extra_space >= 0, 0);
+
   for (i = 0; i < n_requested_sizes; i++)
     spreading[i] = i;
 



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