From 6b228abad039aaf89a35671ffa6c57cce9af51bc Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 13 Aug 2017 08:35:20 +0100 Subject: m_chghost: use an iterator instead of a NULL-checking loop. --- src/modules/m_chghost.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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 ¶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]) { -- cgit v1.2.3