From effc112bed400d632368ca633d8a6600ea8c8aae Mon Sep 17 00:00:00 2001 From: David Athay Date: Mon, 13 Apr 2009 14:48:07 +0100 Subject: Fixed @'s in a user's nick --- src/utils/stringutils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/utils/stringutils.cpp') 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; +} -- cgit v1.2.3-70-g09d2