summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-07 12:25:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-07 12:25:25 +0000
commit9ec715957b95578172c136e6706e58e873956689 (patch)
treeee3b1c2715284b5aecbd47997433fc0d42459784 /src
parent8f79485a75bfc6e1da9a65a81b7688514187b57b (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')
-rw-r--r--src/mode.cpp11
-rw-r--r--src/modules/m_timedbans.cpp2
-rwxr-xr-xsrc/svn-rev.sh2
3 files changed, 7 insertions, 8 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';
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 0af4b7d72..470d0edee 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -83,7 +83,7 @@ class cmd_tban : public command_t
char duration[MAXBUF];
snprintf(duration,MAXBUF,"%lu",Srv->CalcDuration(parameters[1]));
std::string mask = parameters[2];
- char *setban[3];
+ char *setban[32];
setban[0] = parameters[0];
setban[1] = "+b";
setban[2] = parameters[2];
diff --git a/src/svn-rev.sh b/src/svn-rev.sh
index 0df5e545b..7b85fd8af 100755
--- a/src/svn-rev.sh
+++ b/src/svn-rev.sh
@@ -1 +1 @@
-echo 3513
+echo 3515