diff options
Diffstat (limited to 'src/userprocess.cpp')
-rw-r--r-- | src/userprocess.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp index a72d738c3..dd6a4c24d 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -107,7 +107,7 @@ void InspIRCd::ProcessUser(userrec* cu) } else { - current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over 512chars) Please shorten it.", current->nick); + current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over %d chars) Please shorten it.", current->nick, MAXBUF-2); current->recvq = ""; } } @@ -177,8 +177,8 @@ void InspIRCd::ProcessUser(userrec* cu) std::string single_line = current->GetBuffer(); current->bytes_in += single_line.length(); current->cmds_in++; - if (single_line.length() > 512) - single_line.resize(512); + if (single_line.length() > MAXBUF - 2) /* MAXBUF is 514 to allow for neccessary line terminators */ + single_line.resize(MAXBUF - 2); /* So to trim to 512 here, we use MAXBUF - 2 */ EventHandler* old_comp = this->SE->GetRef(currfd); |