From 7e738485ee081caf017412cb97dda80219ae6bbe Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 4 Apr 2023 21:43:23 +0300 Subject: [PATCH] Don't sprintf with no arguments in Command.Reply --- ui/command-processor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/command-processor.go b/ui/command-processor.go index ae0e2e1..c6afbe0 100644 --- a/ui/command-processor.go +++ b/ui/command-processor.go @@ -50,7 +50,10 @@ type Command struct { type CommandAutocomplete Command func (cmd *Command) Reply(message string, args ...interface{}) { - cmd.Room.AddServiceMessage(fmt.Sprintf(message, args...)) + if len(args) > 0 { + message = fmt.Sprintf(message, args...) + } + cmd.Room.AddServiceMessage(message) cmd.UI.Render() }