Commit b811927e authored by Max Kellermann's avatar Max Kellermann

TagId3: use std::string for partial string copy

parent 83cdd0a0
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <glib.h> #include <glib.h>
#include <id3tag.h> #include <id3tag.h>
#include <string>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -339,10 +341,9 @@ tag_id3_import_ufid(struct id3_tag *id3_tag, ...@@ -339,10 +341,9 @@ tag_id3_import_ufid(struct id3_tag *id3_tag,
if (value == nullptr || length == 0) if (value == nullptr || length == 0)
continue; continue;
char *p = g_strndup((const char *)value, length); std::string p((const char *)value, length);
tag_handler_invoke_tag(handler, handler_ctx, tag_handler_invoke_tag(handler, handler_ctx,
TAG_MUSICBRAINZ_TRACKID, p); TAG_MUSICBRAINZ_TRACKID, p.c_str());
g_free(p);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment