summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-26 21:45:37 +0200
committerattilamolnar <attilamolnar@hush.com>2012-08-08 13:34:05 +0200
commit6e2b6aae53f007df51a4ded1058d2bc790a3892d (patch)
tree8a7d6a3abfda1583cdeae1f2b3155759111f0e88 /src
parent44e89aafb69fb266bdf780d12a31947bfff4e330 (diff)
Remove sprintf from the two implementations of ModeHandler::RemoveMode
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp16
1 files changed, 6 insertions, 10 deletions
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<std::string> 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<std::string> 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<std::string> 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<std::string> parameters;
parameters.push_back(channel->name);
- parameters.push_back(moderemove);
+ parameters.push_back("-");
+ parameters[1].push_back(this->GetModeChar());
ServerInstance->SendMode(parameters, ServerInstance->FakeClient);
}
}