summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2009-04-13 14:48:07 +0100
committerDavid Athay <ko2fan@gmail.com>2009-04-13 14:48:07 +0100
commiteffc112bed400d632368ca633d8a6600ea8c8aae (patch)
tree794f9d826e2bc3a3df6ac0796856e7d6bb8f6b17 /src/utils/stringutils.cpp
parentd8e3acb5253eb01231136b131e5b156034aaa7a9 (diff)
downloadmana-client-effc112bed400d632368ca633d8a6600ea8c8aae.tar.gz
mana-client-effc112bed400d632368ca633d8a6600ea8c8aae.tar.bz2
mana-client-effc112bed400d632368ca633d8a6600ea8c8aae.tar.xz
mana-client-effc112bed400d632368ca633d8a6600ea8c8aae.zip
Fixed @'s in a user's nick
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 6a88a12e..2f9bc9a8 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -61,3 +61,16 @@ const char *ipToString(int address)
return asciiIP;
}
+
+std::string &removeBadChars(std::string &str)
+{
+ std::string::size_type pos;
+ do
+ {
+ pos = str.find_first_of("@#[]");
+ if (pos != std::string::npos)
+ str.erase(pos, 1);
+ } while (pos != std::string::npos);
+
+ return str;
+}