From f204a14e00278d99ad940a055aeeb315439999b4 Mon Sep 17 00:00:00 2001 From: Thomas Jager Date: Fri, 31 Jul 2015 13:03:48 +0200 Subject: [PATCH] Only trim newline/linefeed --- irc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/irc.go b/irc.go index c63f0d1..ec708fa 100644 --- a/irc.go +++ b/irc.go @@ -100,7 +100,8 @@ func Fuzz(data []byte) int { //Parse raw irc messages func parseToEvent(msg string) (*Event, error) { - msg = strings.TrimSpace(msg) //Remove \r\n + msg = strings.TrimSuffix(msg, "\n") //Remove \r\n + msg = strings.TrimSuffix(msg, "\r") event := &Event{Raw: msg} if len(msg) < 5 { return nil, errors.New("Malformed msg from server")