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 0ae1ac616a985588f2ac9d83be699da21ce1c11a..3ff6814d3af24eb79491a9357a71cac8eee33704 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 bf2ba93805a079de9b0d22cd217a3c45673ee252..d95c85d8e08209f028c506a7e3147c6b659b9c79 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);