check for key_compare_func != NULL (reported by Michal Kara).
authorTim Janik <timj@gtk.org>
Fri, 18 Sep 1998 02:12:32 +0000 (02:12 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 18 Sep 1998 02:12:32 +0000 (02:12 +0000)
Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>

        * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
        by Michal Kara).

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gtree.c
gtree.c

index a9e713e..191fea9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index a9e713e..191fea9 100644 (file)
@@ -1,3 +1,8 @@
+Fri Sep 18 03:41:20 1998  Tim Janik  <timj@gtk.org>
+
+       * gtree.c (g_tree_new): check for key_compare_func != NULL (reported
+       by Michal Kara).
+
 Thu Sep 17 18:55:46 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * config.h.in: removed from repository
index 00bfb14..0d7f78c 100644 (file)
@@ -87,6 +87,8 @@ g_tree_new (GCompareFunc key_compare_func)
 {
   GRealTree *rtree;
 
+  g_return_val_if_fail (key_compare_func != NULL, NULL);
+
   rtree = g_new (GRealTree, 1);
   rtree->root = NULL;
   rtree->key_compare = key_compare_func;
diff --git a/gtree.c b/gtree.c
index 00bfb14..0d7f78c 100644 (file)
--- a/gtree.c
+++ b/gtree.c
@@ -87,6 +87,8 @@ g_tree_new (GCompareFunc key_compare_func)
 {
   GRealTree *rtree;
 
+  g_return_val_if_fail (key_compare_func != NULL, NULL);
+
   rtree = g_new (GRealTree, 1);
   rtree->root = NULL;
   rtree->key_compare = key_compare_func;