Skip to content

Commit

Permalink
m_chghost: use an iterator instead of a NULL-checking loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed Aug 16, 2017
1 parent 346f47c commit 6b228ab
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/modules/m_chghost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ class CommandChghost : public Command

CmdResult Handle(const std::vector<std::string> &parameters, User *user)
{
const char* x = parameters[1].c_str();

if (parameters[1].length() > ServerInstance->Config->Limits.MaxHost)
{
user->WriteNotice("*** CHGHOST: Host too long");
return CMD_FAILURE;
}

for (; *x; x++)
for (std::string::const_iterator x = parameters[1].begin(); x != parameters[1].end(); x++)
{
if (!hostmap[(unsigned char)*x])
{
Expand Down

0 comments on commit 6b228ab

Please sign in to comment.