diff options
author | Peter Powell <petpow@saberuk.com> | 2017-08-13 08:35:20 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-08-16 17:21:16 +0100 |
commit | 6b228abad039aaf89a35671ffa6c57cce9af51bc (patch) | |
tree | 54def0e6005de63df6d305e375c401184ac695a5 | |
parent | 346f47c26a0ace1c922d2a240e0013b9085479c1 (diff) |
m_chghost: use an iterator instead of a NULL-checking loop.
-rw-r--r-- | src/modules/m_chghost.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 60146c78b..ad8353cbd 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -37,15 +37,13 @@ class CommandChghost : public Command CmdResult Handle(const std::vector<std::string> ¶meters, 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]) { |