summaryrefslogtreecommitdiff
path: root/src/modules/m_blockcolor.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-31 00:02:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-31 00:02:00 +0000
commit79b99cf0e928a7f08cf922db24bbd69ff4ce5c7e (patch)
tree963d2d84ac4591ec516756ebe8d03e103ac9ee75 /src/modules/m_blockcolor.cpp
parent95cb80851bdc0d466de87f8706459ae7ca027cb0 (diff)
Blockcolor now blocks reverse and other mirc sillies
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2713 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_blockcolor.cpp')
-rw-r--r--src/modules/m_blockcolor.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index ef26e746b..4be733f85 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -69,7 +69,7 @@ class ModuleBlockColor : public Module
chanrec* c = (chanrec*)dest;
char ctext[MAXBUF];
char *ctptr = ctext;
- snprintf(ctext,MAXBUF,"%s",text.c_str());
+ strlcpy(ctext,text.c_str(),MAXBUF);
if (c->IsCustomModeSet('c'))
@@ -77,17 +77,18 @@ class ModuleBlockColor : public Module
/* Instead of using strchr() here, do our own loop. Hopefully faster. --w00t */
while (ctptr && *ctptr)
{
- switch (*ctptr)
+ switch (*ctptr++)
{
case 2:
case 3:
+ case 15:
+ case 21:
+ case 22:
case 31:
WriteServ(user->fd,"404 %s %s :Can't send colors to channel (+c set)",user->nick, c->name);
return 1;
- break;
+ break;
}
-
- *ctptr++;
}
}
}
@@ -101,7 +102,7 @@ class ModuleBlockColor : public Module
chanrec* c = (chanrec*)dest;
char ctext[MAXBUF];
char *ctptr = ctext;
- snprintf(ctext,MAXBUF,"%s",text.c_str());
+ strlcpy(ctext,text.c_str(),MAXBUF);
if (c->IsCustomModeSet('c'))
@@ -109,17 +110,18 @@ class ModuleBlockColor : public Module
/* Instead of using strchr() here, do our own loop. Hopefully faster. --w00t */
while (ctptr && *ctptr)
{
- switch (*ctptr)
+ switch (*ctptr++)
{
case 2:
case 3:
+ case 15:
+ case 21:
+ case 22:
case 31:
WriteServ(user->fd,"404 %s %s :Can't send colors to channel (+c set)",user->nick, c->name);
return 1;
- break;
+ break;
}
-
- ctptr++;
}
}
}