summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_hostchange.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index 21623e51b..cc7c57508 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -147,15 +147,14 @@ class ModuleHostChange : public Module
{
// first take their nick and strip out non-dns, leaving just [A-Z0-9\-]
std::string complete;
- std::string old = user->nick;
- for (unsigned int j = 0; j < old.length(); j++)
+ for (std::string::const_iterator j = user->nick.begin(); j != user->nick.end(); ++j)
{
- if (((old[j] >= 'A') && (old[j] <= 'Z')) ||
- ((old[j] >= 'a') && (old[j] <= 'z')) ||
- ((old[j] >= '0') && (old[j] <= '9')) ||
- (old[j] == '-'))
+ if (((*j >= 'A') && (*j <= 'Z')) ||
+ ((*j >= 'a') && (*j <= 'z')) ||
+ ((*j >= '0') && (*j <= '9')) ||
+ (*j == '-'))
{
- complete = complete + old[j];
+ complete = complete + *j;
}
}
if (complete.empty())