diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-07 12:25:25 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-07 12:25:25 +0000 |
commit | 9ec715957b95578172c136e6706e58e873956689 (patch) | |
tree | ee3b1c2715284b5aecbd47997433fc0d42459784 /src/mode.cpp | |
parent | 8f79485a75bfc6e1da9a65a81b7688514187b57b (diff) |
Fixed timedbans (new mode parser didnt like being passed const char* elements as it likes to change them inplace)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3516 e03df62e-2008-0410-955e-edbf42e46eb7
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'; |