summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-29 05:53:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-29 05:53:30 +0000
commit4cc7c2ba94faf1fe7443876a04ea6ad2203bcffe (patch)
treed2a5078bd0cd19513c6da85ea29303f338298b74
parentb0a467e8d3064177e3ceaaa6c207a3e625d2125a (diff)
Compensate for ~ in ident length
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1551 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/users.h3
-rw-r--r--src/commands.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/include/users.h b/include/users.h
index a093e633e..69ea434fb 100644
--- a/include/users.h
+++ b/include/users.h
@@ -121,8 +121,9 @@ class userrec : public connection
char nick[NICKMAX];
/** The users ident reply.
+ * Two characters are added to the user-defined limit to compensate for the tilde etc.
*/
- char ident[IDENTMAX+1];
+ char ident[IDENTMAX+2];
/** The host displayed to non-opers (used for cloaking etc).
* This usually matches the value of userrec::host.
diff --git a/src/commands.cpp b/src/commands.cpp
index 692c5fc40..26cfa0da6 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1163,7 +1163,7 @@ void handle_user(char **parameters, int pcnt, userrec *user)
}
else {
strcpy(user->ident,"~"); /* we arent checking ident... but these days why bother anyway? */
- strlcat(user->ident,parameters[0],IDENTMAX);
+ strlcat(user->ident,parameters[0],IDENTMAX+1);
strlcpy(user->fullname,parameters[3],MAXGECOS);
user->registered = (user->registered | 1);
}
@@ -2407,7 +2407,7 @@ void handle_N(char token,char* params,serverrec* source,serverrec* reply, char*
strlcpy(clientlist[nick]->host, host,160);
strlcpy(clientlist[nick]->dhost, dhost,160);
clientlist[nick]->server = (char*)FindServerNamePtr(server);
- strlcpy(clientlist[nick]->ident, ident,IDENTMAX); // +1 char to compensate for tilde
+ strlcpy(clientlist[nick]->ident, ident,IDENTMAX+1); // +1 char to compensate for tilde
strlcpy(clientlist[nick]->fullname, gecos,MAXGECOS);
strlcpy(clientlist[nick]->ip,ipaddr,16);
clientlist[nick]->signon = TS;