Commit d8bcdca7 authored by Max Kellermann's avatar Max Kellermann

IcyMetaDataParser: pass StringView to icy_add_item()

parent d663f814
...@@ -67,18 +67,16 @@ IcyMetaDataParser::Data(size_t length) noexcept ...@@ -67,18 +67,16 @@ IcyMetaDataParser::Data(size_t length) noexcept
} }
static void static void
icy_add_item(TagBuilder &tag, TagType type, const char *value) noexcept icy_add_item(TagBuilder &tag, TagType type, StringView value) noexcept
{ {
size_t length = strlen(value); if (value.size >= 2 && value.front() == '\'' && value.back() == '\'') {
if (length >= 2 && value[0] == '\'' && value[length - 1] == '\'') {
/* strip the single quotes */ /* strip the single quotes */
++value; ++value.data;
length -= 2; value.size -= 2;
} }
if (length > 0) if (value.size > 0)
tag.AddItem(type, {value, length}); tag.AddItem(type, value);
} }
static void static void
......
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