summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-09 17:51:22 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-09 17:51:22 +0000
commit40d674d14cff051207e2004211b9e4e7686bb524 (patch)
tree25f8eea23504946c4caa7b30b5a2530b119b880a /src/mode.cpp
parentd483a20dcb724d28777908c5da0505624729a840 (diff)
Fixes to way allocations are handled
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1346 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 87876141a..69284ab5c 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -552,12 +552,13 @@ std::string compress_modes(std::string modes,bool channelmodes)
static char v[2];
v[0] = (unsigned char)j;
v[1] = '\0';
- std::string::size_type pos = modes.find(std::string(v));
+ std::string mode_str = v;
+ std::string::size_type pos = modes.find(mode_str);
if (pos != std::string::npos)
{
log(DEBUG,"all occurances of mode %c to be deleted...",(unsigned char)j);
- while (modes.find(std::string(v)) != std::string::npos)
- modes.erase(modes.find(std::string(v)),1);
+ while (modes.find(mode_str) != std::string::npos)
+ modes.erase(modes.find(mode_str),1);
log(DEBUG,"New mode line: %s",modes.c_str());
}
}