[glib] g_string_append_len() accept NULL with length == 0



commit 056326c1e96db2c2101fa320062e0c9146f0d73f
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Apr 15 10:11:30 2010 -0400

    g_string_append_len() accept NULL with length == 0

 glib/gstring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gstring.c b/glib/gstring.c
index 5a6b5df..c231f3e 100644
--- a/glib/gstring.c
+++ b/glib/gstring.c
@@ -874,7 +874,7 @@ g_string_append_len (GString	 *string,
                      gssize       len)    
 {
   g_return_val_if_fail (string != NULL, NULL);
-  g_return_val_if_fail (val != NULL, string);
+  g_return_val_if_fail (len == 0 || val != NULL, string);
 
   return g_string_insert_len (string, -1, val, len);
 }



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