diff options
author | Adam <Adam@anope.org> | 2016-12-07 11:29:47 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-12-07 11:29:47 -0500 |
commit | a64ede8632e1e60aba9d04d2fea9d107e339b7f3 (patch) | |
tree | 8a2e6e6cc16bee5d9beb52b27b11e4e17962f68a /src | |
parent | 87ec095a89bbc73a4dd16858bea499f466066212 (diff) |
Remove C style var args from Channel::Kick
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 53c5ae81b..bb6bc3083 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -756,14 +756,8 @@ bool Channel::KickInternal(const MessageSource &source, const Anope::string &nic return true; } -bool Channel::Kick(User *source, User *u, const char *reason, ...) +bool Channel::Kick(User *source, User *u, const Anope::string &reason) { - va_list args; - char buf[BUFSIZE] = ""; - va_start(args, reason); - vsnprintf(buf, BUFSIZE - 1, reason, args); - va_end(args); - /* Do not kick protected clients or Ulines */ if (u->IsProtected()) return false; @@ -771,9 +765,9 @@ bool Channel::Kick(User *source, User *u, const char *reason, ...) if (source == NULL) source = this->ci->WhoSends(); - if (!this->KickInternal(source, u->nick, buf)) + if (!this->KickInternal(source, u->nick, reason)) return false; - IRCD->SendKick(source, this, u, buf); + IRCD->SendKick(source, this, u, reason); return true; } @@ -901,7 +895,7 @@ bool Channel::CheckKick(User *user) Log(LOG_DEBUG) << "Autokicking " << user->nick << " (" << mask << ") from " << this->name; this->SetMode(NULL, "BAN", mask); - this->Kick(NULL, user, "%s", reason.c_str()); + this->Kick(NULL, user, reason); return true; } |