mirror of
https://github.com/matrix-construct/construct
synced 2024-10-05 07:08:53 +02:00
ircd::net: No user input so use standard ::snprintf() here.
This commit is contained in:
parent
3c0d5bd5d6
commit
8fc336a1e9
1 changed files with 4 additions and 2 deletions
|
@ -534,7 +534,9 @@ std::string
|
||||||
ircd::net::string(const ip::tcp::endpoint &ep)
|
ircd::net::string(const ip::tcp::endpoint &ep)
|
||||||
{
|
{
|
||||||
std::string ret(256, char{});
|
std::string ret(256, char{});
|
||||||
ret.resize(fmt::sprintf(mutable_buffer{ret}, "%s:%u", string(address(ep)), port(ep)));
|
const auto addr{string(address(ep))};
|
||||||
|
const auto data{const_cast<char *>(ret.data())};
|
||||||
|
ret.resize(snprintf(data, ret.size(), "%s:%u", addr.c_str(), port(ep)));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,7 +714,7 @@ ircd::net::socket::disconnect(const dc &type)
|
||||||
|
|
||||||
if(sd.is_open())
|
if(sd.is_open())
|
||||||
log::debug("socket(%p): disconnect: %s type: %d",
|
log::debug("socket(%p): disconnect: %s type: %d",
|
||||||
this,
|
(const void *)this,
|
||||||
string(remote()),
|
string(remote()),
|
||||||
uint(type));
|
uint(type));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue