Omit last empty string from MOTD reply

This commit is contained in:
Sergey Matveev 2014-05-14 16:18:40 +04:00
parent 043730c355
commit 6d2c47a7af

View File

@ -84,7 +84,7 @@ func (daemon *Daemon) SendMotd(client *Client) {
}
client.ReplyNicknamed("375", "- "+daemon.hostname+" Message of the day -")
for _, s := range bytes.Split(motd, []byte("\n")) {
for _, s := range bytes.Split(bytes.TrimRight(motd, "\n"), []byte("\n")) {
client.ReplyNicknamed("372", "- "+string(s))
}
client.ReplyNicknamed("376", "End of /MOTD command")