small cleanup. (#433387)

2007-04-25  Paolo Borellki  <pborelli@katamail.com>

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


svn path=/trunk/; revision=5460
This commit is contained in:
Paolo Borellki 2007-04-25 18:43:44 +00:00 committed by Paolo Borelli
parent a5aebabd2d
commit ab1a2d5d65
2 changed files with 6 additions and 5 deletions

View File

@ -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> 2007-04-24 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols: * glib/glib.symbols:

View File

@ -2288,13 +2288,10 @@ g_strsplit (const gchar *string,
while (--max_tokens && s) while (--max_tokens && s)
{ {
gsize len; gsize len;
gchar *new_string;
len = s - remainder; len = s - remainder;
new_string = g_new (gchar, len + 1); string_list = g_slist_prepend (string_list,
strncpy (new_string, remainder, len); g_strndup (remainder, len));
new_string[len] = 0;
string_list = g_slist_prepend (string_list, new_string);
n++; n++;
remainder = s + delimiter_len; remainder = s + delimiter_len;
s = strstr (remainder, delimiter); s = strstr (remainder, delimiter);