1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 08:56: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
+2 -2
View File
@@ -102,7 +102,7 @@ public:
auto *doc = yyjson_read_opts(const_cast<char *>(message.content.c_str()), message.content.length(), flags, nullptr, &error);
if (!doc)
{
SendError(reply, RPC::ERR_PARSE_ERROR, Anope::printf("JSON parse error #%u: %s", error.code, error.msg));
SendError(reply, RPC::ERR_PARSE_ERROR, Anope::Format("JSON parse error #%u: %s", error.code, error.msg));
return true;
}
@@ -164,7 +164,7 @@ public:
if (request.data.size() < event->GetMinParams())
{
auto error = Anope::printf("Not enough parameters for %s (given %zu, expected %zu)",
auto error = Anope::Format("Not enough parameters for %s (given %zu, expected %zu)",
request.name.c_str(), request.data.size(), event->GetMinParams());
SendError(reply, RPC::ERR_INVALID_PARAMS, error, id);
return true;