summaryrefslogtreecommitdiff
path: root/modules/commands/os_svs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/os_svs.cpp')
-rw-r--r--modules/commands/os_svs.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/commands/os_svs.cpp b/modules/commands/os_svs.cpp
index 13b29e84c..9fb1d63c3 100644
--- a/modules/commands/os_svs.cpp
+++ b/modules/commands/os_svs.cpp
@@ -34,11 +34,12 @@ class CommandOSSVSNick : public Command
return;
}
- /* Truncate long nicknames to Config->NickLen characters */
- if (newnick.length() > Config->NickLen)
+ /* Truncate long nicknames to nicklen characters */
+ unsigned nicklen = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen");
+ if (newnick.length() > nicklen)
{
- source.Reply(_("Nick \002%s\002 was truncated to %d characters."), newnick.c_str(), Config->NickLen, newnick.c_str());
- newnick = params[1].substr(0, Config->NickLen);
+ source.Reply(_("Nick \002%s\002 was truncated to %d characters."), newnick.c_str(), nicklen, newnick.c_str());
+ newnick = params[1].substr(0, nicklen);
}
/* Check for valid characters */