char moderemove[MAXBUF];
userrec* n = new userrec(ServerInstance);
n->SetFd(FD_MAGIC_NUMBER);
+ modelist copy;
+ /* Make a copy of it, because we cant change the list whilst iterating over it */
for(modelist::iterator it = el->begin(); it != el->end(); it++)
+ {
+ copy.push_back(*it);
+ }
+ for(modelist::iterator it = copy.begin(); it != copy.end(); it++)
{
ServerInstance->Log(DEBUG,"Remove item %s",it->mask.c_str());
sprintf(moderemove,"-%c",this->GetModeChar());
}
return MODEACTION_ALLOW;
}
- else
- {
- /* Tried to remove something that wasn't set */
- TellNotSet(source, channel, parameter);
- }
}
+ /* Tried to remove something that wasn't set */
+ TellNotSet(source, channel, parameter);
parameter = "";
return MODEACTION_DENY;
}
else
{
- // Hmm, taking an exception off a non-existant list, DIE
+ /* Hmm, taking an exception off a non-existant list, DIE */
+ TellNotSet(source, channel, parameter);
parameter = "";
return MODEACTION_DENY;
}