diff options
Diffstat (limited to 'src')
-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 |