sanity check the input paramter.
authorPaolo Borelli <pborelli@katamail.com>
Mon, 23 Feb 2009 14:38:20 +0000 (14:38 +0000)
committerPaolo Borelli <pborelli@src.gnome.org>
Mon, 23 Feb 2009 14:38:20 +0000 (14:38 +0000)
2009-02-23  Paolo Borelli  <pborelli@katamail.com>

* glib/gutf8.c (_g_utf8_make_valid):
sanity check the input paramter.

svn path=/trunk/; revision=7902

ChangeLog
glib/gutf8.c

index f72d954..9e164c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-23  Paolo Borelli  <pborelli@katamail.com>
+
+       * glib/gutf8.c (_g_utf8_make_valid):
+       sanity check the input paramter. 
+
 2009-02-23  Tor Lillqvist  <tml@novell.com>
 
        Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion
index bf06458..da4a769 100644 (file)
@@ -1833,11 +1833,13 @@ _g_utf8_make_valid (const gchar *name)
   GString *string;
   const gchar *remainder, *invalid;
   gint remaining_bytes, valid_bytes;
-  
+
+  g_return_val_if_fail (name != NULL, NULL);
+
   string = NULL;
   remainder = name;
   remaining_bytes = strlen (name);
-  
+
   while (remaining_bytes != 0) 
     {
       if (g_utf8_validate (remainder, remaining_bytes, &invalid))