From 6d2c47a7af3afc09b3b8899d9b770b58e2792d31 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 14 May 2014 16:18:40 +0400 Subject: [PATCH] Omit last empty string from MOTD reply --- daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon.go b/daemon.go index 59d6372..49e2dd8 100644 --- a/daemon.go +++ b/daemon.go @@ -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") -- 2.44.0