1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 23:03:12 +02:00

Fix crash bug when there is a caps kicker in a channel but no alphabetic characters on a line.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2973 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2010-05-21 22:36:06 +00:00
parent 0a91d582c9
commit 8e39d5f219
+3 -3
View File
@@ -172,7 +172,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
Allow = true;
else if (ci->botflags.HasFlag(BS_DONTKICKVOICES) && ci->c->HasUserStatus(u, CMODE_VOICE))
Allow = true;
if (buf && !check_access(u, ci, CA_NOKICK) && Allow)
{
/* Bolds kicker */
@@ -222,7 +222,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
* percentage of caps to kick for; the rest is ignored. -GD
*/
if (i >= ci->capsmin && i * 100 / (i + l) >= ci->capspercent) {
if (i && l && i >= ci->capsmin && i * 100 / (i + l) >= ci->capspercent) {
check_ban(ci, u, TTB_CAPS);
bot_kick(ci, u, BOT_REASON_CAPS);
return;
@@ -664,7 +664,7 @@ static void check_ban(ChannelInfo *ci, User *u, int ttbtype)
if (!bd)
return;
/* Don't ban ulines */
if (is_ulined(u->server->name))
return;