UriUtil: uri_remove_auth() returns std::string

This commit is contained in:
Max Kellermann
2013-10-23 21:38:07 +02:00
parent c3e720279c
commit 3d12f8d246
6 changed files with 25 additions and 38 deletions

View File

@@ -38,8 +38,6 @@
#include "tag/ApeReplayGain.hxx"
#include "Log.hxx"
#include <glib.h>
static constexpr Domain decoder_thread_domain("decoder_thread");
/**
@@ -367,13 +365,12 @@ decoder_run_song(decoder_control &dc,
dc.state = DecoderState::ERROR;
const char *error_uri = song->uri;
char *allocated = uri_remove_auth(error_uri);
if (allocated != nullptr)
error_uri = allocated;
const std::string allocated = uri_remove_auth(error_uri);
if (!allocated.empty())
error_uri = allocated.c_str();
dc.error.Format(decoder_domain,
"Failed to decode %s", error_uri);
g_free(allocated);
}
dc.client_cond.signal();