summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-14 12:07:20 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-14 12:07:20 +0100
commit66221de4b6cca64692c84eabfe0b81cabdbd00bc (patch)
tree5ff9bcf620a95354c421d7eb75aa55f637cc6170 /src
parent3ccae741b8c60acc2d95f2dc54d7e69014090807 (diff)
cmode_k Fix oversight in substr() conversion
While at it, introduce a named constant for maximum key length
Diffstat (limited to 'src')
-rw-r--r--src/modes/cmode_k.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index 6738c046e..980b3215a 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -52,7 +52,8 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s
channel->SetMode(this, adding);
if (adding)
{
- parameter.erase(32);
+ if (parameter.length() > maxkeylen)
+ parameter.erase(maxkeylen);
ext.set(channel, parameter);
}
else