aboutsummaryrefslogtreecommitdiffstats
path: root/src/metadataChunk.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/metadataChunk.c4
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);