diff --git a/ChangeLog b/ChangeLog index 0ae1ac616..3ff6814d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-04-25 Paolo Borellki + + * glib/gstrfuncs.c (g_strsplit): small cleanup. (#433387) + 2007-04-24 Matthias Clasen * glib/glib.symbols: diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index bf2ba9380..d95c85d8e 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -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);