diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 21:27:39 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 21:27:39 +0000 |
commit | b848ca14335adcb924acb7977d93e0d76b9437b7 (patch) | |
tree | b02af028dfcaea81fff788f6982bf08f7e863c8d /src | |
parent | d0fe371f7a286c082430b0ea4aa59cd39454cfa4 (diff) |
Fixed search and replace, code pilfered from m_alias (i think someone misread the help for std::string::replace...)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6162 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index a8b76b182..c66b6730a 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -573,7 +573,6 @@ void ServerConfig::Read(bool bail, userrec* user) { static char debug[MAXBUF]; /* Temporary buffer for debugging value */ static char maxkeep[MAXBUF]; /* Temporary buffer for WhoWasMaxKeep value */ - static char somax[MAXBUF]; /* Temporary buffer for SOMAXCONN default */ int rem = 0, add = 0; /* Number of modules added, number of modules removed */ std::ostringstream errstr; /* String stream containing the error output */ diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 351ef688f..03b691ece 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -94,11 +94,12 @@ class DNSBLResolver : public Resolver if (bitmask != 0) { std::string reason = ConfEntry->reason; - - std::string::size_type pos; - while ((pos = reason.find("%ip%")) != std::string::npos) + std::string::size_type x = reason.find("%ip%"); + while (x != std::string::npos) { - reason.replace(pos, 4, them->GetIPString()); + reason.erase(x, 4); + reason.insert(x, "%ip%"); + x = reason.find("%ip%"); } ServerInstance->WriteOpers("*** Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); |