]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Fix this to not have the same issue
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 834ff3e20ac944ef267b2125972463638e334232..a171c32d203aec7ae4cafc8712aea2b95941bc4d 100644 (file)
@@ -63,8 +63,6 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache
 
        Instance->Logs->Log("USERS", DEBUG,"New user fd: %d", socket);
 
-       int j = 0;
-
        this->unregistered_count++;
 
        (*(this->clientlist))[New->uuid] = New;
@@ -80,9 +78,8 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache
        New->lastping = 1;
 
        /* Smarter than your average bear^H^H^H^Hset of strlcpys. */
-       for (const char* temp = New->GetIPString(); *temp && j < 64; temp++, j++)
-               New->dhost[j] = New->host[j] = *temp;
-       New->dhost[j] = New->host[j] = 0;
+       New->dhost.assign(New->GetIPString(), 0, 64);
+       New->host.assign(New->GetIPString(), 0, 64);
 
        Instance->Users->AddLocalClone(New);
        Instance->Users->AddGlobalClone(New);
@@ -192,7 +189,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache
 void UserManager::QuitUser(User *user, const std::string &quitreason, const char* operreason)
 {
        ServerInstance->Logs->Log("USERS", DEBUG,"QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str());
-       user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident.c_str(), user->host, *operreason ? operreason : quitreason.c_str());
+       user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str());
        user->quietquit = false;
        user->quitmsg = quitreason;