From 6e2b6aae53f007df51a4ded1058d2bc790a3892d Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 26 Jul 2012 21:45:37 +0200 Subject: Remove sprintf from the two implementations of ModeHandler::RemoveMode --- src/mode.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index 083445cef..845b23fb0 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -899,9 +899,6 @@ bool ModeParser::DelModeWatcher(ModeWatcher* mw) */ void ModeHandler::RemoveMode(User* user, irc::modestacker* stack) { - char moderemove[MAXBUF]; - std::vector parameters; - if (user->IsModeSet(this->GetModeChar())) { if (stack) @@ -910,9 +907,10 @@ void ModeHandler::RemoveMode(User* user, irc::modestacker* stack) } else { - sprintf(moderemove,"-%c",this->GetModeChar()); + std::vector parameters; parameters.push_back(user->nick); - parameters.push_back(moderemove); + parameters.push_back("-"); + parameters[1].push_back(this->GetModeChar()); ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient); } } @@ -923,9 +921,6 @@ void ModeHandler::RemoveMode(User* user, irc::modestacker* stack) */ void ModeHandler::RemoveMode(Channel* channel, irc::modestacker* stack) { - char moderemove[MAXBUF]; - std::vector parameters; - if (channel->IsModeSet(this->GetModeChar())) { if (stack) @@ -934,9 +929,10 @@ void ModeHandler::RemoveMode(Channel* channel, irc::modestacker* stack) } else { - sprintf(moderemove,"-%c",this->GetModeChar()); + std::vector parameters; parameters.push_back(channel->name); - parameters.push_back(moderemove); + parameters.push_back("-"); + parameters[1].push_back(this->GetModeChar()); ServerInstance->SendMode(parameters, ServerInstance->FakeClient); } } -- cgit v1.2.3