diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-25 20:09:03 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-25 20:09:03 +0000 |
commit | ce10ba4b119faac3eb7c5d1251b1a875d28056c1 (patch) | |
tree | 0770735cd27e4ac6ca137656c341c6ca346e45ab /src/metadataChunk.c | |
parent | b6bcc65a454b711b586ca221323f1efba35e6dab (diff) | |
download | mpd-ce10ba4b119faac3eb7c5d1251b1a875d28056c1.tar.gz mpd-ce10ba4b119faac3eb7c5d1251b1a875d28056c1.tar.xz mpd-ce10ba4b119faac3eb7c5d1251b1a875d28056c1.zip |
fix a big time bug in metadataChunk (off by one in an array assignment)
also, now we have metadata in our streams
git-svn-id: https://svn.musicpd.org/mpd/trunk@2337 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/metadataChunk.c')
-rw-r--r-- | src/metadataChunk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/metadataChunk.c b/src/metadataChunk.c index 49cba9d90..84817eb0e 100644 --- a/src/metadataChunk.c +++ b/src/metadataChunk.c @@ -38,7 +38,7 @@ void initMetadataChunk(MetadataChunk * chunk) { MpdTag * metadataChunkToMpdTagDup(MetadataChunk * chunk) { MpdTag * ret = newMpdTag(); - chunk->buffer[METADATA_BUFFER_LENGTH] = '\0'; + chunk->buffer[METADATA_BUFFER_LENGTH-1] = '\0'; dupElementToTag(ret->name, chunk->name); dupElementToTag(ret->title, chunk->title); @@ -65,6 +65,8 @@ void copyMpdTagToMetadataChunk(MpdTag * tag, MetadataChunk * chunk) { initMetadataChunk(chunk); + if(!tag) return; + copyStringToChunk(tag->name, chunk->name); copyStringToChunk(tag->title, chunk->title); copyStringToChunk(tag->artist, chunk->artist); |