diff options
author | waker <wakeroid@gmail.com> | 2011-11-28 20:55:41 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-11-28 20:55:41 +0100 |
commit | 62495cc1ab25b02e6bf4838592dbadc133e59f26 (patch) | |
tree | d79011da560df8568a0e3c8c24feb8c43df332a1 /plugins | |
parent | c1f85294a6b8b9a2c4f03cf7a07ee51f020a8bee (diff) |
fixed m3uext parser bug
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/m3u/m3u.c | 13 |
1 files changed, 12 insertions, 1 deletions
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) { |