diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-06 01:07:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-06 01:07:47 +0000 |
commit | f8f23a35adf98465b3f217f94da39371567e0a4d (patch) | |
tree | 5a6dcb2cc01cc0e6a98f7e8095d55d01dc76ef02 | |
parent | c5fa02be4c23399a3639f8bc8fe921f362d004d7 (diff) |
Comments in the right places
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3479 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/mode.cpp | 12 | ||||
-rwxr-xr-x | src/svn-rev.sh | 2 |
2 files changed, 7 insertions, 7 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) { diff --git a/src/svn-rev.sh b/src/svn-rev.sh index 395b2b3da..5353554b9 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3476 +echo 3478 |