From be26ace5452fd2fc7cc48c305fcd6c05d010a27e Mon Sep 17 00:00:00 2001 From: mik2k2 <44849223+mik2k2@users.noreply.github.com> Date: Thu, 23 Dec 2021 19:11:00 +0100 Subject: [PATCH] fix crash on specifying exactly one more -v flag than the max level --- cmd/ssh-chat/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ssh-chat/cmd.go b/cmd/ssh-chat/cmd.go index 0aef593..5d727d3 100644 --- a/cmd/ssh-chat/cmd.go +++ b/cmd/ssh-chat/cmd.go @@ -85,7 +85,7 @@ func main() { // Figure out the log level numVerbose := len(options.Verbose) - if numVerbose > len(logLevels) { + if numVerbose >= len(logLevels) { numVerbose = len(logLevels) - 1 }