From a64ede8632e1e60aba9d04d2fea9d107e339b7f3 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 7 Dec 2016 11:29:47 -0500 Subject: Remove C style var args from Channel::Kick --- modules/chanserv/ban.cpp | 8 ++++---- modules/chanserv/enforce.cpp | 10 +++++----- modules/chanserv/kick.cpp | 8 ++++---- modules/chanserv/suspend.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'modules/chanserv') diff --git a/modules/chanserv/ban.cpp b/modules/chanserv/ban.cpp index 44e2752a5..2b73df8fb 100644 --- a/modules/chanserv/ban.cpp +++ b/modules/chanserv/ban.cpp @@ -173,11 +173,11 @@ class CommandCSBan : public Command if (ci->IsSignKick() || (ci->IsSignKickLevel() && !source.AccessFor(ci).HasPriv("SIGNKICK"))) { signkickformat = signkickformat.replace_all_cs("%m", reason); - c->Kick(ci->WhoSends(), u2, "%s", signkickformat.c_str()); + c->Kick(ci->WhoSends(), u2, signkickformat); } else { - c->Kick(ci->WhoSends(), u2, "%s", reason.c_str()); + c->Kick(ci->WhoSends(), u2, reason); } } } @@ -230,11 +230,11 @@ class CommandCSBan : public Command { reason += " (Matches " + mask + ")"; signkickformat = signkickformat.replace_all_cs("%m", reason); - c->Kick(ci->WhoSends(), uc->user, "%s", signkickformat.c_str()); + c->Kick(ci->WhoSends(), uc->user, signkickformat); } else { - c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); + c->Kick(ci->WhoSends(), uc->user, "{0} (Matches {1})", reason, mask); } } } diff --git a/modules/chanserv/enforce.cpp b/modules/chanserv/enforce.cpp index c2a9fbe2d..e1d084075 100644 --- a/modules/chanserv/enforce.cpp +++ b/modules/chanserv/enforce.cpp @@ -73,7 +73,7 @@ class CommandCSEnforce : public Command Anope::string mask = ci->GetIdealBan(user); Anope::string reason = Language::Translate(user, _("RESTRICTED enforced by ")) + source.GetNick(); ci->c->SetMode(NULL, "BAN", mask); - ci->c->Kick(NULL, user, "%s", reason.c_str()); + ci->c->Kick(NULL, user, reason); } source.Reply(_("\002Restricted\002 enforced on \002{0}\002."), ci->GetName()); @@ -105,7 +105,7 @@ class CommandCSEnforce : public Command Anope::string reason = Language::Translate(user, _("REGONLY enforced by ")) + source.GetNick(); if (!ci->c->HasMode("REGISTEREDONLY")) ci->c->SetMode(NULL, "BAN", mask); - ci->c->Kick(NULL, user, "%s", reason.c_str()); + ci->c->Kick(NULL, user, reason); } source.Reply(_("\002Registered only\002 enforced on \002{0}\002."), ci->GetName()); @@ -137,7 +137,7 @@ class CommandCSEnforce : public Command Anope::string reason = Language::Translate(user, _("SSLONLY enforced by ")) + source.GetNick(); if (!ci->c->HasMode("SSL")) ci->c->SetMode(NULL, "BAN", mask); - ci->c->Kick(NULL, user, "%s", reason.c_str()); + ci->c->Kick(NULL, user, reason); } source.Reply(_("\002SSL only\002 enforced on %s."), ci->GetName().c_str()); @@ -166,7 +166,7 @@ class CommandCSEnforce : public Command User *user = users[i]; Anope::string reason = Language::Translate(user, _("BANS enforced by ")) + source.GetNick(); - ci->c->Kick(NULL, user, "%s", reason.c_str()); + ci->c->Kick(NULL, user, reason); } source.Reply(_("\002Bans\002 enforced on %s."), ci->GetName().c_str()); @@ -221,7 +221,7 @@ class CommandCSEnforce : public Command User *user = users[i]; Anope::string reason = Language::Translate(user, _("LIMIT enforced by ")) + source.GetNick(); - ci->c->Kick(NULL, user, "%s", reason.c_str()); + ci->c->Kick(NULL, user, reason); } source.Reply(_("LIMIT enforced on \002{0}\002, \002{1]\002 users removed."), ci->GetName(), users.size()); diff --git a/modules/chanserv/kick.cpp b/modules/chanserv/kick.cpp index a1ac7f62f..505f74893 100644 --- a/modules/chanserv/kick.cpp +++ b/modules/chanserv/kick.cpp @@ -84,11 +84,11 @@ class CommandCSKick : public Command if (ci->IsSignKick() || (ci->IsSignKickLevel() && !u_access.HasPriv("SIGNKICK"))) { signkickformat = signkickformat.replace_all_cs("%m", reason); - c->Kick(ci->WhoSends(), u2, "%s", signkickformat.c_str()); + c->Kick(ci->WhoSends(), u2, signkickformat); } else { - c->Kick(ci->WhoSends(), u2, "%s", reason.c_str()); + c->Kick(ci->WhoSends(), u2, reason); } } } @@ -121,11 +121,11 @@ class CommandCSKick : public Command { reason += " (Matches " + mask + ")"; signkickformat = signkickformat.replace_all_cs("%m", reason); - c->Kick(ci->WhoSends(), uc->user, "%s", signkickformat.c_str()); + c->Kick(ci->WhoSends(), uc->user, signkickformat); } else { - c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); + c->Kick(ci->WhoSends(), uc->user, "{0} (Matches {1})", reason, mask); } } } diff --git a/modules/chanserv/suspend.cpp b/modules/chanserv/suspend.cpp index c8c451548..7895aaa02 100644 --- a/modules/chanserv/suspend.cpp +++ b/modules/chanserv/suspend.cpp @@ -186,7 +186,7 @@ class CommandCSSuspend : public Command } for (unsigned i = 0; i < users.size(); ++i) - ci->c->Kick(NULL, users[i], "%s", !reason.empty() ? reason.c_str() : Language::Translate(users[i], _("This channel has been suspended."))); + ci->c->Kick(NULL, users[i], !reason.empty() ? reason : Language::Translate(users[i], _("This channel has been suspended."))); } Log(LOG_ADMIN, source, this, ci) << "(" << (!reason.empty() ? reason : "No reason") << "), expires on " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never"); -- cgit