diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-24 20:56:01 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-24 20:56:01 +0000 |
commit | 496ef08226f93d877d90e56076704795fa349a4b (patch) | |
tree | cf932ef60b1309c947daa461819355c8803727dc /src/channels.cpp | |
parent | d53d8da69b4aecef4f929693b43c07046f2e2136 (diff) |
Fixed perplexing bug in custom mode removal (apparent with +C and +c)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@829 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 310195679..4bec1bcdb 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -132,16 +132,13 @@ void chanrec::SetCustomMode(char mode,bool mode_on) log(DEBUG,"Custom mode %c set",mode); } else { - char temp[MAXBUF]; - int count = 0; - for (int q = 0; q < strlen(custom_modes); q++) { - if (custom_modes[q] != mode) { - temp[count++] = mode; - } - } - temp[count] = '\0'; - strncpy(custom_modes,temp,MAXMODES); - log(DEBUG,"Custom mode %c removed",mode); + + std::string a = this->custom_modes; + int pos = a.find(mode); + a.erase(pos,1); + strncpy(this->custom_modes,a.c_str(),MAXMODES); + + log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes); this->SetCustomModeParam(mode,"",false); } } |