X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=3acc8f2a0cc2bc1c8009b21f9d3a5b28ee5f5d48;hb=59b1a8955142935b02af6446005ab47fc7c3fc8c;hp=c892862730c7a826435030f40225da81ab7a491c;hpb=6824a483e3bc4a584b998929ac066dda2ae24c8b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index c89286273..3acc8f2a0 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -397,6 +397,7 @@ void kill_link(userrec *user,const char* r) log(DEBUG,"closing fd %lu",(unsigned long)user->fd); if (user->registered == 7) { + purge_empty_chans(user); FOREACH_MOD(I_OnUserQuit,OnUserQuit(user,reason)); WriteCommonExcept(user,"QUIT :%s",reason); } @@ -425,7 +426,6 @@ void kill_link(userrec *user,const char* r) // this must come before the WriteOpers so that it doesnt try to fill their buffer with anything // if they were an oper with +s. if (user->registered == 7) { - purge_empty_chans(user); // fix by brain: only show local quits because we only show local connects (it just makes SENSE) if (user->fd > -1) WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason); @@ -519,7 +519,7 @@ void AddWhoWas(userrec* u) { whowas_hash::iterator iter = whowas.find(u->nick); WhoWasUser *a = new WhoWasUser(); - strlcpy(a->nick,u->nick,NICKMAX); + strlcpy(a->nick,u->nick,NICKMAX-1); strlcpy(a->ident,u->ident,IDENTMAX); strlcpy(a->dhost,u->dhost,160); strlcpy(a->host,u->host,160); @@ -608,7 +608,7 @@ void AddClient(int socket, int port, bool iscached, in_addr ip4) log(DEBUG,"AddClient: %d %d %s",socket,port,ipaddr); clientlist[tempnick]->fd = socket; - strlcpy(clientlist[tempnick]->nick, tn2,NICKMAX); + strlcpy(clientlist[tempnick]->nick, tn2,NICKMAX-1); /* We don't know the host yet, dns lookup could still be going on, * so instead we just put the ip address here, for now. */