From 25655488133872fc7d5938731c10e0257e740cb6 Mon Sep 17 00:00:00 2001 From: raylu Date: Wed, 2 Feb 2011 16:36:53 -0500 Subject: [PATCH] Don't Sprintf in say if no arguments --- handler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handler.go b/handler.go index ae35b65..e864976 100644 --- a/handler.go +++ b/handler.go @@ -140,7 +140,10 @@ func command(conn *irc.Conn, nick *irc.Nick, text, target string) { } func say(conn *irc.Conn, target, message string, a ...interface{}) { - text := strings.Replace(fmt.Sprintf(message, a...), "\n", " ", -1) + if len(a) > 0 { + message = fmt.Sprintf(message, a...) + } + text := strings.Replace(message, "\n", " ", -1) if isChannel(target) { conn.Privmsg(target, text) } else {