From: Michael Poole Date: Tue, 3 Mar 2015 02:41:12 +0000 (-0500) Subject: s_auth.c: Fix off-by-one errors in last commit. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=c2ad630afaab5353b2656f6cd5d591f8a2488692 s_auth.c: Fix off-by-one errors in last commit. --- diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 476cce5..b3e993a 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -270,12 +270,13 @@ static int auth_set_username(struct AuthRequest *auth) { /* Prepend ~ to user->username. */ s = user->username; - s[USERLEN-1] = '\0'; + s[USERLEN] = '\0'; for (last = '~'; (ch = *s) != '\0'; ) { *s++ = last; last = ch; } + *s++ = last; *s = '\0'; } /* else cleaned version of client-provided name is in place */