small cleanup. (#433387)
authorPaolo Borellki <pborelli@katamail.com>
Wed, 25 Apr 2007 18:43:44 +0000 (18:43 +0000)
committerPaolo Borelli <pborelli@src.gnome.org>
Wed, 25 Apr 2007 18:43:44 +0000 (18:43 +0000)
2007-04-25  Paolo Borellki  <pborelli@katamail.com>

* glib/gstrfuncs.c (g_strsplit): small cleanup. (#433387)

svn path=/trunk/; revision=5460

ChangeLog
glib/gstrfuncs.c

index 0ae1ac6..3ff6814 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-04-25  Paolo Borellki  <pborelli@katamail.com>
+
+       * glib/gstrfuncs.c (g_strsplit): small cleanup. (#433387)
+
 2007-04-24  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/glib.symbols:
index bf2ba93..d95c85d 100644 (file)
@@ -2288,13 +2288,10 @@ g_strsplit (const gchar *string,
       while (--max_tokens && s)
        {
          gsize len;     
-         gchar *new_string;
 
          len = s - remainder;
-         new_string = g_new (gchar, len + 1);
-         strncpy (new_string, remainder, len);
-         new_string[len] = 0;
-         string_list = g_slist_prepend (string_list, new_string);
+         string_list = g_slist_prepend (string_list,
+                                        g_strndup (remainder, len));
          n++;
          remainder = s + delimiter_len;
          s = strstr (remainder, delimiter);