aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tag.c b/src/tag.c
index ae0c3c87c..8a6846d94 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -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);