From f51bc8e9b9facc8299c78c77b5d997bf06d22010 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 28 Aug 2016 22:42:46 +0200 Subject: [PATCH] Fix panic for debug.Log() with empty string --- src/restic/debug/debug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restic/debug/debug.go b/src/restic/debug/debug.go index 8d20b72e2..12b8c490a 100644 --- a/src/restic/debug/debug.go +++ b/src/restic/debug/debug.go @@ -146,7 +146,7 @@ func Log(tag string, f string, args ...interface{}) { current := time.Now() opts.last[process{tag, goroutine}] = current - if f[len(f)-1] != '\n' { + if len(f) == 0 || f[len(f)-1] != '\n' { f += "\n" }