1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 11:36:38 +02:00

Improve how Anope formats C strings.

This commit is contained in:
Sadie Powell
2025-08-02 18:09:31 +01:00
parent e6e812c43c
commit b2d40d4189
40 changed files with 157 additions and 183 deletions
+3 -3
View File
@@ -626,9 +626,9 @@ Anope::string Uplink::str() const
switch (protocol)
{
case AF_INET:
return Anope::printf("%s:%u", this->host.c_str(), this->port);
return Anope::Format("%s:%u", this->host.c_str(), this->port);
case AF_INET6:
return Anope::printf("[%s]:%u", this->host.c_str(), this->port);
return Anope::Format("[%s]:%u", this->host.c_str(), this->port);
case AF_UNIX:
return this->host;
}
@@ -776,7 +776,7 @@ void Conf::LoadConf(File &file)
if (!file.Open())
{
throw ConfigException(Anope::printf("File %s could not be opened: %s.",
throw ConfigException(Anope::Format("File %s could not be opened: %s.",
file.GetPath().c_str(), strerror(errno)));
}