summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-22 13:19:15 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-22 13:19:15 +0200
commit21a5f346135811e2d5d063121db1563e83d62960 (patch)
treeabf3f4889089760088f39dc276f270e807b04137
parentb0eca1dbccdbe5ac22b96375011a5cf51a487c47 (diff)
core_ison Truncate string after sending it on overflow instead of recreating it
-rw-r--r--src/coremods/core_ison.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/coremods/core_ison.cpp b/src/coremods/core_ison.cpp
index d127ed344..3edef8275 100644
--- a/src/coremods/core_ison.cpp
+++ b/src/coremods/core_ison.cpp
@@ -44,6 +44,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User
{
User *u;
std::string reply = "303 " + user->nick + " :";
+ const std::string::size_type pos = reply.size();
for (unsigned int i = 0; i < parameters.size(); i++)
{
@@ -54,7 +55,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User
if (reply.length() > 450)
{
user->WriteServ(reply);
- reply = "303 " + user->nick + " :";
+ reply.erase(pos);
}
}
else
@@ -75,7 +76,7 @@ CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User
if (reply.length() > 450)
{
user->WriteServ(reply);
- reply = "303 " + user->nick + " :";
+ reply.erase(pos);
}
}
}