diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 6ce15e203..1b59a1352 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -453,6 +453,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int } char outlist[MAXBUF]; + char mlist[MAXBUF]; char *outpars[32]; int param = 2; int pc = 0; @@ -470,9 +471,10 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int return; } - char* modelist = parameters[1]; /* mode list, e.g. +oo-o * - * parameters[2] onwards are parameters for - * modes that require them :) */ + std::string tidied = this->CompressModes(parameters[1],true); + strlcpy(mlist,tidied.c_str(),MAXBUF); + char* modelist = mlist; + *outlist = *modelist; char* outl = outlist+1; @@ -480,9 +482,6 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int log(DEBUG,"process_modes: modelist: %s",modelist); - std::string tidied = this->CompressModes(modelist,true); - strlcpy(modelist,tidied.c_str(),MAXBUF); - int len = tidied.length(); while (modelist[len-1] == ' ') modelist[--len] = '\0'; |