Added check for division by 0 in m_message.c Hopefully fixes #25

This commit is contained in:
alxbl 2010-09-07 20:21:29 -04:00
parent e0b0e08d25
commit 829ce93fb8
1 changed files with 2 additions and 1 deletions

View File

@ -554,7 +554,8 @@ msg_channel(int p_or_n, const char *command,
caps++;
len++;
}
if(((caps*100)/(len)) >= 50)
/* Added divide by 0 check --alxbl */
if(len != 0 && ((caps*100)/(len)) >= 50)
{
sendto_one_numeric(source_p, 404, "%s :Cannot send to channel - Your message contains mostly capital letters (+G set)", chptr->chname);
return;