summaryrefslogtreecommitdiff
path: root/src/modules/m_nationalchars.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-05-17 18:00:42 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-05-17 18:00:42 +0200
commitb28782c4a3cd52587d61541bcca4e0b217685c54 (patch)
tree6e2a88b2907821a2ab3c964e582a35cd54066983 /src/modules/m_nationalchars.cpp
parentc1757d9126eb387d7ae0b558dabcad6490f25883 (diff)
Fix incorrect iterator use leading to prematurely exiting loops when quitting users while looping the local user list
Diffstat (limited to 'src/modules/m_nationalchars.cpp')
-rw-r--r--src/modules/m_nationalchars.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp
index f77899ad4..8e74ee3e6 100644
--- a/src/modules/m_nationalchars.cpp
+++ b/src/modules/m_nationalchars.cpp
@@ -292,10 +292,12 @@ class ModuleNationalChars : public Module
return;
const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
- for (UserManager::LocalList::const_iterator iter = list.begin(); iter != list.end(); ++iter)
+ for (UserManager::LocalList::const_iterator iter = list.begin(); iter != list.end(); )
{
/* Fix by Brain: Dont quit UID users */
+ // Quitting the user removes it from the list
User* n = *iter;
+ ++iter;
if (!isdigit(n->nick[0]) && !ServerInstance->IsNick(n->nick))
ServerInstance->Users->QuitUser(n, message);
}