review fixes

This commit is contained in:
Shivaram Lingamneni 2019-02-05 03:04:52 -05:00
parent bf1d758de9
commit 36612f6e2d
1 changed files with 2 additions and 2 deletions

View File

@ -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)