diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 2ff9e003d..02da655d1 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -1127,12 +1127,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int } } - /* This means the mode line is something like: "+o-", we have to take the last char off. - if ((*--modechar == '-') || (*modechar == '+')) + /* This means the mode line is something like: "+o-", we have to take the last char off. */ + char* x = outlist + strlen(outlist) - 1; + while (((*x == '-') || (*x == '+')) && (x != outlist)) { log(DEBUG,"Cut off trailing modifier"); - *modechar = 0; - }*/ + *x-- = 0; + } /* The mode change must be at least two characters long (+ or - and at least one mode) */ if (((*outlist == '+') || (*outlist == '-')) && *(outlist+1)) { |