From 36612f6e2d85c3a46f8c30af5ac4b38a948b93c9 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 5 Feb 2019 03:04:52 -0500 Subject: [PATCH] review fixes --- irc/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irc/client.go b/irc/client.go index c7a20f41..ccc9562b 100644 --- a/irc/client.go +++ b/irc/client.go @@ -625,7 +625,7 @@ func (client *Client) SetNames(username, realname string, fromIdent bool) error if !fromIdent { limit -= 1 // leave room for the prepended ~ } - if len(username) > limit { + if limit < len(username) { username = username[:limit] } @@ -789,7 +789,7 @@ func (client *Client) AllNickmasks() (masks []string) { rawHostname := client.rawHostname vhost := client.getVHostNoMutex() client.stateMutex.RUnlock() - username = strings.ToLower(client.username) + username = strings.ToLower(username) if len(vhost) > 0 { cfvhost, err := Casefold(vhost)