diff options
author | Max Kellermann <max@duempel.org> | 2009-01-13 23:43:16 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-14 09:58:25 +0100 |
commit | 525c507ac56815c295a3c671725c60bfe03baabc (patch) | |
tree | e87ae161715fe428ac55de425ce75ea548f7fff9 /src | |
parent | 7320db5af2cca2040520694aed4996eb84dba323 (diff) | |
download | mpd-525c507ac56815c295a3c671725c60bfe03baabc.tar.gz mpd-525c507ac56815c295a3c671725c60bfe03baabc.tar.xz mpd-525c507ac56815c295a3c671725c60bfe03baabc.zip |
song_save: check for colon and space when loading a tag
matchesAnMpdTagItemKey() broke when two tag items had the same prefix,
because it did not check if the tag name ended after the prefix. Add
a check for the colon and the space after the tag name.
Diffstat (limited to '')
-rw-r--r-- | src/song_save.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/song_save.c b/src/song_save.c index 41e694611..5d446c8f7 100644 --- a/src/song_save.c +++ b/src/song_save.c @@ -90,8 +90,10 @@ static int matchesAnMpdTagItemKey(char *buffer, int *itemType) int i; for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) { - if (0 == strncmp(mpdTagItemKeys[i], buffer, - strlen(mpdTagItemKeys[i]))) { + size_t len = strlen(mpdTagItemKeys[i]); + + if (0 == strncmp(mpdTagItemKeys[i], buffer, len) && + buffer[len] == ':' && buffer[len + 1] == ' ') { *itemType = i; return 1; } |