]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Merge pull request #416 from SaberUK/insp20+clang42-warnings
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 7058cf8d3673f258a4a9000292d4713a7f3c4e9f..5a8f55f11f70ea12955926f7d6f18ffb65eabbe9 100644 (file)
@@ -100,11 +100,6 @@ User* InspIRCd::FindNickOnly(const char* nick)
 }
 
 User *InspIRCd::FindUUID(const std::string &uid)
-{
-       return FindUUID(uid.c_str());
-}
-
-User *InspIRCd::FindUUID(const char *uid)
 {
        user_hash::iterator finduuid = this->Users->uuidlist->find(uid);
 
@@ -114,6 +109,11 @@ User *InspIRCd::FindUUID(const char *uid)
        return finduuid->second;
 }
 
+User *InspIRCd::FindUUID(const char *uid)
+{
+       return FindUUID(std::string(uid));
+}
+
 /* find a channel record by channel name and return a pointer to it */
 Channel* InspIRCd::FindChan(const char* chan)
 {
@@ -140,7 +140,7 @@ Channel* InspIRCd::FindChan(const std::string &chan)
 /* Send an error notice to all users, registered or not */
 void InspIRCd::SendError(const std::string &s)
 {
-       for (std::vector<LocalUser*>::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); i++)
+       for (LocalUserList::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); i++)
        {
                User* u = *i;
                if (u->registered == REG_ALL)
@@ -339,8 +339,8 @@ bool IsNickHandler::Call(const char* n, size_t max)
                return false;
        }
 
-       /* too long? or not -- pointer arithmetic rocks */
-       return (p < max);
+       /* too long? or not */
+       return (p <= max);
 }
 
 /* return true for good ident, false else */