diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-02-11 16:16:39 +0100 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-02-11 16:16:39 +0100 |
commit | 58212b3d2b7197fa7e89de4c97848cdc937b32c3 (patch) | |
tree | 70ead7e6304ce768fbb65680d83aa4f30b1b3baa /src | |
parent | 41c6a4d5efb21d94c8188b06ded74c92c5abe49c (diff) |
Fix exactly <limits:maxchan> long channel names being truncated
Fixes #422 reported by @RawrDragon
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 672d46ea9..229e2b8ea 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -231,7 +231,6 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char if (!user || !cn || user->registered != REG_ALL) return NULL; - char cname[MAXBUF]; std::string privs; Channel *Ptr; @@ -264,7 +263,8 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char } } - strlcpy(cname, cn, ServerInstance->Config->Limits.ChanMax); + std::string cname; + cname.assign(std::string(cn), 0, ServerInstance->Config->Limits.ChanMax); Ptr = ServerInstance->FindChan(cname); bool created_by_local = false; @@ -287,7 +287,7 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char if (IS_LOCAL(user) && override == false) { ModResult MOD_RESULT; - FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, NULL, cname, privs, key ? key : "")); + FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, NULL, cname.c_str(), privs, key ? key : "")); if (MOD_RESULT == MOD_RES_DENY) return NULL; } @@ -307,7 +307,7 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char if (IS_LOCAL(user) && override == false) { ModResult MOD_RESULT; - FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, Ptr, cname, privs, key ? key : "")); + FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, Ptr, cname.c_str(), privs, key ? key : "")); if (MOD_RESULT == MOD_RES_DENY) { return NULL; |