input/InputStream: ReadTag() returns std::unique_ptr<Tag>

This commit is contained in:
Max Kellermann
2017-12-20 15:15:27 +01:00
parent 4c4fa68268
commit 73e69edac3
11 changed files with 41 additions and 37 deletions

View File

@@ -82,11 +82,12 @@ dump_input_stream(InputStream *is)
/* read data and tags from the stream */
while (!is->IsEOF()) {
Tag *tag = is->ReadTag();
if (tag != NULL) {
fprintf(stderr, "Received a tag:\n");
tag_save(stderr, *tag);
delete tag;
{
auto tag = is->ReadTag();
if (tag) {
fprintf(stderr, "Received a tag:\n");
tag_save(stderr, *tag);
}
}
char buffer[4096];