Mercurial > hg > xmms-sid
diff src/xs_stil.c @ 224:df4cb5115322
Removed duplicate function, more portability cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 15 Dec 2004 14:23:03 +0000 |
parents | 16e3b2446a73 |
children | 92bad4c7b998 |
line wrap: on
line diff
--- a/src/xs_stil.c Wed Dec 15 14:18:00 2004 +0000 +++ b/src/xs_stil.c Wed Dec 15 14:23:03 2004 +0000 @@ -91,28 +91,6 @@ } } -gint xs_strmcat(gchar **ppResult, gchar *pStr) -{ - assert(ppResult); - - /* Check the string pointers */ - if (!pStr) return -1; - - if (*ppResult != NULL) - { - *ppResult = (gchar *) g_realloc(*ppResult, strlen(*ppResult) + strlen(pStr) + 1); - if (*ppResult == NULL) return -1; - strcat(*ppResult, pStr); - } else - { - *ppResult = (gchar *) g_malloc(strlen(pStr) + 1); - if (*ppResult == NULL) return -1; - strcpy(*ppResult, pStr); - } - - return 0; -} - /* * Read database to memory @@ -232,19 +210,19 @@ { inLine[eolPos++] = '\n'; inLine[eolPos++] = 0; - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[2]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[2]); } else if (strncmp(inLine, " ARTIST:", 8) == 0) { inLine[eolPos++] = '\n'; inLine[eolPos++] = 0; - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[1]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[1]); } else if (strncmp(inLine, "COMMENT:", 8) == 0) - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), inLine); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), inLine); else if (strncmp(inLine, " ", 8) == 0) - xs_strmcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[8]); + xs_pstrcat(&(tmpNode->subTune[subEntry].pInfo), &inLine[8]); break; }