From fc05827621fe0c623d2fedf9dcb47c17d57bea16 Mon Sep 17 00:00:00 2001 From: Adam- Date: Sun, 21 Mar 2010 19:57:08 +0000 Subject: Made usermax and hostmax configurable git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2829 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/os_chankill.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/os_chankill.c') diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c index bdb3ecc69..2920e0b4d 100644 --- a/src/core/os_chankill.c +++ b/src/core/os_chankill.c @@ -27,7 +27,7 @@ class CommandOSChanKill : public Command const char *expiry, *channel; char reason[BUFSIZE]; time_t expires; - char mask[USERMAX + HOSTMAX + 2]; + char *mask = new char[Config.UserLen + Config.HostLen + 2]; unsigned last_param = 1; Channel *c; @@ -47,6 +47,7 @@ class CommandOSChanKill : public Command if (expires != 0 && expires < 60) { notice_lang(Config.s_OperServ, u, BAD_EXPIRY_TIME); + delete [] mask; return MOD_CONT; } else if (expires > 0) @@ -55,6 +56,7 @@ class CommandOSChanKill : public Command if (params.size() <= last_param) { this->OnSyntaxError(u, ""); + delete [] mask; return MOD_CONT; } snprintf(reason, sizeof(reason), "%s%s", params[last_param].c_str(), (params.size() > last_param + 1 ? params[last_param + 1].c_str() : "")); @@ -76,8 +78,8 @@ class CommandOSChanKill : public Command if (is_oper(uc->user)) continue; - strlcpy(mask, "*@", sizeof(mask)); /* Use *@" for the akill's, */ - strlcat(mask, uc->user->host, sizeof(mask)); + strlcpy(mask, "*@", Config.UserLen + Config.HostLen + 2); /* Use *@" for the akill's, */ + strlcat(mask, uc->user->host, Config.UserLen + Config.HostLen + 2); add_akill(NULL, mask, Config.s_OperServ, expires, realreason.c_str()); check_akill(uc->user->nick.c_str(), uc->user->GetIdent().c_str(), uc->user->host, NULL, NULL); } @@ -87,6 +89,7 @@ class CommandOSChanKill : public Command else notice_lang(Config.s_OperServ, u, CHAN_X_NOT_IN_USE, channel); } + delete [] mask; return MOD_CONT; } -- cgit