From c2ad630afaab5353b2656f6cd5d591f8a2488692 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 2 Mar 2015 21:41:12 -0500 Subject: [PATCH] s_auth.c: Fix off-by-one errors in last commit. --- ircd/s_auth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.20.1