diff --git a/ircd/m_id.cc b/ircd/m_id.cc index c197db127..041bd7344 100644 --- a/ircd/m_id.cc +++ b/ircd/m_id.cc @@ -707,7 +707,15 @@ ircd::m::id::event::v3::v3(const mutable_buffer &out, }; out[0] = '$'; - return b64encode_unpadded(out + 1, hash); + const string_view hashb64 + { + b64encode_unpadded(out + 1, hash) + }; + + return string_view + { + ircd::data(out), 1 + ircd::size(hashb64) + }; }()} { } @@ -742,10 +750,13 @@ ircd::m::id::event::v4::v4(const mutable_buffer &out, }; out[0] = '$'; - string_view ret; - ret = b64encode_unpadded(out + 1, hash); - ret = b64tob64url(out + 1, ret); - return ret; + string_view hashb64; + hashb64 = b64encode_unpadded(out + 1, hash); + hashb64 = b64tob64url(out + 1, hashb64); + return string_view + { + ircd::data(out), 1 + ircd::size(hashb64) + }; }()} { }