# HG changeset patch # User Matti Hamalainen # Date 1218581860 -10800 # Node ID 630c9662e0f16c5355acfc054a7cbf15efa56ec4 # Parent 6a6f27de82aa97e2d3b7459b731a7c9657004ef0 No, no, no and no. "type identifier[variable]" is NOT a proper way to allocate tables (or strings, for that matter). diff -r 6a6f27de82aa -r 630c9662e0f1 src/streambrowser/xiph.c --- a/src/streambrowser/xiph.c Wed Aug 13 01:01:25 2008 +0300 +++ b/src/streambrowser/xiph.c Wed Aug 13 01:57:40 2008 +0300 @@ -226,21 +226,16 @@ static gboolean genre_match(gchar *string1, gchar *string2) { - char *saveptr = NULL; - char *token; + gchar *saveptr = NULL, *token; gboolean matched = FALSE; - char temp1[strlen(string1) + 1]; - char temp2[strlen(string2) + 1]; + gchar *temp1 = g_strdup(string1), + *temp2 = g_strdup(string2); - /* these are required for strtok_r to work properly */ - strcpy(temp1, string1); - strcpy(temp2, string2); - token = strtok_r(temp1, " ", &saveptr); while (token != NULL) { if (mystrcasestr(temp2, token)) matched = TRUE; - + token = strtok_r(NULL, " ", &saveptr); }