summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-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