diff options
author | Max Kellermann <max@duempel.org> | 2013-12-04 14:43:09 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-04 14:43:09 +0100 |
commit | b811927e0ef5164d9eb00b92f0829c05e5b70f8a (patch) | |
tree | b70baddfe7ba35aeea5b1b49854f635e0f6bbd09 | |
parent | 83cdd0a0c86ae705513225816f8df857c96b4a1f (diff) | |
download | mpd-b811927e0ef5164d9eb00b92f0829c05e5b70f8a.tar.gz mpd-b811927e0ef5164d9eb00b92f0829c05e5b70f8a.tar.xz mpd-b811927e0ef5164d9eb00b92f0829c05e5b70f8a.zip |
TagId3: use std::string for partial string copy
Diffstat (limited to '')
-rw-r--r-- | src/tag/TagId3.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tag/TagId3.cxx b/src/tag/TagId3.cxx index 3da8cafd7..c5b3d0536 100644 --- a/src/tag/TagId3.cxx +++ b/src/tag/TagId3.cxx @@ -34,6 +34,8 @@ #include <glib.h> #include <id3tag.h> +#include <string> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -339,10 +341,9 @@ tag_id3_import_ufid(struct id3_tag *id3_tag, if (value == nullptr || length == 0) continue; - char *p = g_strndup((const char *)value, length); + std::string p((const char *)value, length); tag_handler_invoke_tag(handler, handler_ctx, - TAG_MUSICBRAINZ_TRACKID, p); - g_free(p); + TAG_MUSICBRAINZ_TRACKID, p.c_str()); } } |