From 14e4768140d796b3cb9eb979e74e48bffabd9bfc Mon Sep 17 00:00:00 2001 From: special Date: Wed, 16 Jul 2008 09:50:23 +0000 Subject: Applied patch by psychon to make AddExtBanChar correctly take a single char git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10024 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index d2c4c7c3e..7b23025e0 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -470,15 +470,16 @@ std::string InspIRCd::TimeString(time_t curtime) } // You should only pass a single character to this. -void InspIRCd::AddExtBanChar(const char *c) +void InspIRCd::AddExtBanChar(char c) { std::string &tok = Config->data005; + std::string::size_type ebpos; - if (tok.find(" EXTBAN=:") == std::string::npos) + if ((ebpos = tok.find(" EXTBAN=:")) == std::string::npos) { tok.append(" EXTBAN=:"); - tok.append(c); + tok.push_back(c); } else - tok.insert(tok.find(" EXTBAN=:") + 9, c); + tok.insert(ebpos + 9, 1, c); } -- cgit v1.2.3