From 695fb4c9b026132544132a595afdbf99b9206ef9 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 2 May 2018 12:12:19 -0700 Subject: [PATCH] ircd::net: Ensure proper string() is resolved; minor cleanup. --- ircd/net.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ircd/net.cc b/ircd/net.cc index a9b1b95ca..a9ac7e409 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -3405,7 +3405,7 @@ ircd::net::operator<<(std::ostream &s, const ipport &t) { thread_local char buf[256]; const critical_assertion ca; - s << string(buf, t); + s << net::string(buf, t); return s; } @@ -3449,16 +3449,18 @@ ircd::net::string(const mutable_buffer &buf, { const auto len { - is_v4(ipp)? - fmt::sprintf(buf, "%s:%u", - ip::address_v4{host4(ipp)}.to_string(), - port(ipp)): - - is_v6(ipp)? - fmt::sprintf(buf, "%s:%u", - ip::address_v6{std::get(ipp)}.to_string(), - port(ipp)): - + is_v4(ipp)? fmt::sprintf + { + buf, "%s:%u", + ip::address_v4{host4(ipp)}.to_string(), + port(ipp) + }: + is_v6(ipp)? fmt::sprintf + { + buf, "%s:%u", + ip::address_v6{std::get(ipp)}.to_string(), + port(ipp) + }: 0 };