summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-16 09:50:23 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-16 09:50:23 +0000
commit14e4768140d796b3cb9eb979e74e48bffabd9bfc (patch)
treee57758a708015353bed13a70e25c1d7777cf977b
parent403d16068410909b8d352588dc83f6d255a018b7 (diff)
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
-rw-r--r--include/inspircd.h2
-rw-r--r--src/helperfuncs.cpp9
-rw-r--r--src/modules/m_muteban.cpp2
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_services_account.cpp4
5 files changed, 10 insertions, 9 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 595e65db9..10729d308 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -877,7 +877,7 @@ class CoreExport InspIRCd : public classbase
/** Adds an extban char to the 005 token.
*/
- void AddExtBanChar(const char *c);
+ void AddExtBanChar(char c);
char* GetReadBuffer()
{
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);
}
diff --git a/src/modules/m_muteban.cpp b/src/modules/m_muteban.cpp
index 30e96e9a9..649d5a3c2 100644
--- a/src/modules/m_muteban.cpp
+++ b/src/modules/m_muteban.cpp
@@ -70,7 +70,7 @@ class ModuleQuietBan : public Module
virtual void On005Numeric(std::string &output)
{
- ServerInstance->AddExtBanChar("m");
+ ServerInstance->AddExtBanChar('m');
}
};
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 11a74bd1e..f29cbf04a 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -70,7 +70,7 @@ class ModuleNoNickChange : public Module
virtual void On005Numeric(std::string &output)
{
- ServerInstance->AddExtBanChar("N");
+ ServerInstance->AddExtBanChar('N');
}
virtual int OnUserPreNick(User* user, const std::string &newnick)
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 60d852cf5..118e152e3 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -64,8 +64,8 @@ class ModuleServicesAccount : public Module
virtual void On005Numeric(std::string &t)
{
- ServerInstance->AddExtBanChar("R");
- ServerInstance->AddExtBanChar("M");
+ ServerInstance->AddExtBanChar('R');
+ ServerInstance->AddExtBanChar('M');
}
/* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */