summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-06 01:07:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-06 01:07:47 +0000
commitf8f23a35adf98465b3f217f94da39371567e0a4d (patch)
tree5a6dcb2cc01cc0e6a98f7e8095d55d01dc76ef02 /src/mode.cpp
parentc5fa02be4c23399a3639f8bc8fe921f362d004d7 (diff)
Comments in the right places
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3479 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 003168c97..00369a96a 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -1061,9 +1061,6 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (param < pcnt)
{
- /* Null terminate it early for the 'else' below
- * so it can use strchr (ugh)
- */
*outl++ = *modechar;
chan->SetCustomMode(*modechar,mdir);
// include parameters in output if mode has them
@@ -1094,27 +1091,30 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
/* Null terminate it now we're done */
*outl = 0;
+
+ /************ Fast, but confusing string tidying ************/
outl = outlist;
while (*outl && (*outl < 'A'))
outl++;
/* outl now points to the first mode character after +'s and -'s */
outl--;
/* Now points at first mode-modifier + or - symbol */
-
char* trim = outl;
/* Now we tidy off any trailing -'s etc */
while (*trim++);
trim--;
while ((*--trim == '+') || (*trim == '-'))
*trim = 0;
-
+ /************ Done wih the string tidy functions ************/
+
+
/* The mode change must be at least two characters long (+ or - and at least one mode) */
if (((*outl == '+') || (*outl == '-')) && *(outl+1))
{
for (ptr = 0; ptr < pc; ptr++)
{
charlcat(outl,' ',MAXBUF);
- strlcat(outl,outpars[ptr],MAXBUF);
+ strlcat(outl,outpars[ptr],MAXBUF-1);
}
if (local)
{