From 79b99cf0e928a7f08cf922db24bbd69ff4ce5c7e Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 31 Dec 2005 00:02:00 +0000 Subject: Blockcolor now blocks reverse and other mirc sillies git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2713 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_blockcolor.cpp | 22 ++++++++++++---------- 1 file 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++; } } } -- cgit v1.2.3