From 62495cc1ab25b02e6bf4838592dbadc133e59f26 Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 28 Nov 2011 20:55:41 +0100 Subject: fixed m3uext parser bug --- plugins/m3u/m3u.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index f19a674c..34f00ca4 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -94,7 +94,18 @@ load_m3u (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab uint8_t nm[n+1]; memcpy (nm, p, n); nm[n] = 0; - sscanf (nm, "%d,%1000s - %1000s", &length, artist, title); + length = atoi (nm); + char *c = nm; + while (*c && *c != ',') { + c++; + } + if (*c == ',') { + c++; + if (2 != sscanf (c, "%1000s - %1000s", artist, title)) { + strncpy (artist, c, sizeof (artist)-1); + artist[sizeof(artist)-1] = 0; + } + } } } while (p < end && *p >= 0x20) { -- cgit v1.2.3