g_dir_open: added g_return_val_if_fail() to prevent us from calling
authorMichael Natterer <mitch@gimp.org>
Fri, 8 Feb 2002 17:08:22 +0000 (17:08 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Fri, 8 Feb 2002 17:08:22 +0000 (17:08 +0000)
2002-02-08  Michael Natterer  <mitch@gimp.org>

* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
us from calling opendir(NULL) (which simply crashes).

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/gdir.c

index 24826b5..78a042d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index 24826b5..78a042d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Michael Natterer  <mitch@gimp.org>
+
+       * glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
+       us from calling opendir(NULL) (which simply crashes).
+
 2002-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/gfileutils.c (g_file_test): Extended documentation.
index ffea4f6..aaf967a 100644 (file)
@@ -61,7 +61,11 @@ g_dir_open (const gchar  *path,
             guint         flags,
             GError      **error)
 {
-  GDir *dir = g_new (GDir, 1);
+  GDir *dir;
+
+  g_return_val_if_fail (path != NULL, NULL);
+
+  dir = g_new (GDir, 1);
 
   dir->dir = opendir (path);