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:
@@ -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
|
||||
|
Reference in New Issue
Block a user