diff options
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -612,10 +612,9 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2) static void appendToTagItems(MpdTag * tag, int type, char *value, int len) { int i = tag->numOfItems; + char *dup = malloc(len + 1); - char *dup; - dup = malloc(len + 1); - strncpy(dup, value, len); + memcpy(dup, value, len); dup[len] = '\0'; fixUtf8(dup); |