summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-03-13 15:41:10 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-03-13 15:41:10 +0100
commit5c96689b177ded5b864f848687ec98f922215276 (patch)
tree18955d2425667d904ebfb1d4349ac4c1e6d5b27a /src/channels.cpp
parentb18319769864542912bec9646986ef229a884bde (diff)
Fix NAMES list getting truncated on servers having an excessively long server name
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 73d408fb8..6c9bd7c85 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -783,6 +783,7 @@ void Channel::UserList(User *user)
*/
bool has_user = this->HasUser(user);
+ const size_t maxlen = MAXBUF - 10 - ServerInstance->Config->ServerName.size();
std::string prefixlist;
std::string nick;
for (UserMembIter i = userlist.begin(); i != userlist.end(); ++i)
@@ -807,7 +808,7 @@ void Channel::UserList(User *user)
if (nick.empty())
continue;
- if (list.size() + prefixlist.length() + nick.length() + 1 > 480)
+ if (list.size() + prefixlist.length() + nick.length() + 1 > maxlen)
{
/* list overflowed into multiple numerics */
user->WriteNumeric(RPL_NAMREPLY, list);