From af0f219afc4099a6cc0b8b7f2d96786f0baf6b21 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Mar 2006 13:34:04 +0000 Subject: Made host fields more correct 64 in length with 63 copies git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3425 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/connection.h | 2 +- include/users.h | 6 +++--- src/message.cpp | 4 ++-- src/mode.cpp | 5 +++-- src/users.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/connection.h b/include/connection.h index db76859d7..032f9ba6c 100644 --- a/include/connection.h +++ b/include/connection.h @@ -43,7 +43,7 @@ class connection : public Extensible /** Hostname of connection. Not used if this is a serverrec */ - char host[160]; + char host[64]; /** Stats counter for bytes inbound */ diff --git a/include/users.h b/include/users.h index d64c94280..3b1ff5003 100644 --- a/include/users.h +++ b/include/users.h @@ -136,7 +136,7 @@ class userrec : public connection /** The host displayed to non-opers (used for cloaking etc). * This usually matches the value of userrec::host. */ - char dhost[160]; + char dhost[64]; /** The users full name. */ @@ -347,8 +347,8 @@ class WhoWasUser public: char nick[NICKMAX]; char ident[IDENTMAX+1]; - char dhost[160]; - char host[160]; + char dhost[64]; + char host[64]; char fullname[MAXGECOS+1]; char server[256]; time_t signon; diff --git a/src/message.cpp b/src/message.cpp index 436cc1ed3..0e9d7e8e7 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -227,7 +227,7 @@ void ChangeDisplayedHost(userrec* user, const char* host) return; FOREACH_MOD(I_OnChangeHost,OnChangeHost(user,host)); } - strlcpy(user->dhost,host,160); + strlcpy(user->dhost,host,63); WriteServ(user->fd,"396 %s %s :is now your hidden host",user->nick,user->dhost); } @@ -419,7 +419,7 @@ void TidyBan(char *ban) strlcpy(NICK,temp,NICKMAX-1); strlcpy(IDENT,pos_of_pling,IDENTMAX+1); - strlcpy(HOST,pos_of_at,160); + strlcpy(HOST,pos_of_at,63); snprintf(ban,MAXBUF,"%s!%s@%s",NICK,IDENT,HOST); } diff --git a/src/mode.cpp b/src/mode.cpp index 8644af8cd..30000dfe2 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -1228,7 +1228,8 @@ bool ModeParser::ProcessModuleUmode(char umode, userrec* source, void* dest, boo { s2 = new userrec; strlcpy(s2->nick,Config->ServerName,NICKMAX-1); - strlcpy(s2->modes,"o",52); + *s2->modes = 'o'; + *(s2->modes+1) = 0; s2->fd = -1; source = s2; faked = true; @@ -1430,7 +1431,7 @@ void cmd_mode::Handle (char **parameters, int pcnt, userrec *user) if (outpars[0]) { char b[MAXBUF]; - strlcpy(b,"",MAXBUF); + *b = 0; unsigned int z = 0; unsigned int i = 0; while (i < strlen (outpars)) diff --git a/src/users.cpp b/src/users.cpp index d6e44c494..fb5079569 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -519,8 +519,8 @@ void AddWhoWas(userrec* u) WhoWasUser *a = new WhoWasUser(); 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); + strlcpy(a->dhost,u->dhost,63); + strlcpy(a->host,u->host,63); strlcpy(a->fullname,u->fullname,MAXGECOS); if (u->server) strlcpy(a->server,u->server,256); @@ -610,8 +610,8 @@ void AddClient(int socket, int port, bool iscached, in_addr ip4) /* 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. */ - strlcpy(clientlist[tempnick]->host, ipaddr, 160); - strlcpy(clientlist[tempnick]->dhost, ipaddr, 160); + strlcpy(clientlist[tempnick]->host, ipaddr, 63); + strlcpy(clientlist[tempnick]->dhost, ipaddr, 63); clientlist[tempnick]->server = (char*)FindServerNamePtr(Config->ServerName); strlcpy(clientlist[tempnick]->ident, "unknown",IDENTMAX); clientlist[tempnick]->registered = 0; -- cgit v1.2.3