tag/IcyMetadataParser: do not null-terminate strings in icy_parse_tag()

Just pass std::string_views into the unmodified buffer to
icy_parse_tag_item().
This commit is contained in:
Max Kellermann
2023-12-20 19:54:20 +01:00
parent 2618294eb7
commit e443ee357a
2 changed files with 12 additions and 17 deletions

View File

@@ -2,8 +2,6 @@
* Unit tests for class IcyMetaDataParser.
*/
#include "util/ScopeExit.hxx"
/* include the .cxx file to get access to internal functions */
#include "tag/IcyMetaDataParser.cxx"
@@ -16,13 +14,11 @@
static std::unique_ptr<Tag>
icy_parse_tag(const char *p)
{
char *q = strdup(p);
AtScopeExit(q) { free(q); };
return icy_parse_tag(
#ifdef HAVE_ICU_CONVERTER
nullptr,
#endif
q, q + strlen(q));
p, p + strlen(p));
}
static void