summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp17
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);
}
}