aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag/TagBuilder.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/tag/TagBuilder.cxx')
-rw-r--r--src/tag/TagBuilder.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tag/TagBuilder.cxx b/src/tag/TagBuilder.cxx
index 85060e9ee..c9ebcd654 100644
--- a/src/tag/TagBuilder.cxx
+++ b/src/tag/TagBuilder.cxx
@@ -23,6 +23,7 @@
#include "TagPool.hxx"
#include "TagString.hxx"
#include "Tag.hxx"
+#include "util/WritableBuffer.hxx"
#include <assert.h>
#include <string.h>
@@ -184,17 +185,17 @@ TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
assert(value != nullptr);
assert(length > 0);
- char *p = FixTagString(value, length);
- if (p != nullptr) {
- value = p;
- length = strlen(value);
+ auto f = FixTagString(value, length);
+ if (!f.IsNull()) {
+ value = f.data;
+ length = f.size;
}
tag_pool_lock.lock();
auto i = tag_pool_get_item(type, value, length);
tag_pool_lock.unlock();
- free(p);
+ free(f.data);
items.push_back(i);
}