From 8ac1a786dd44ce64106aacac684fd70f22b948bb Mon Sep 17 00:00:00 2001 From: dpapastamos <52283948+dpapastamos@users.noreply.github.com> Date: Mon, 1 Jul 2019 19:10:09 +0100 Subject: [PATCH] Fix argument length checks (#1595) --- pkg/terminal/command.go | 2 +- service/debugger/locations.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/terminal/command.go b/pkg/terminal/command.go index b1ad7281..45c8fd94 100644 --- a/pkg/terminal/command.go +++ b/pkg/terminal/command.go @@ -2057,7 +2057,7 @@ func checkpoints(t *Term, ctx callContext, args string) error { } func clearCheckpoint(t *Term, ctx callContext, args string) error { - if len(args) < 0 { + if len(args) == 0 { return errors.New("not enough arguments to clear-checkpoint") } if args[0] != 'c' { diff --git a/service/debugger/locations.go b/service/debugger/locations.go index d1329139..e70f92cc 100644 --- a/service/debugger/locations.go +++ b/service/debugger/locations.go @@ -72,7 +72,7 @@ func parseLocationSpec(locStr string) (LocationSpec, error) { case '/': if rest[len(rest)-1] == '/' { rx, rest := readRegex(rest[1:]) - if len(rest) < 0 { + if len(rest) == 0 { return nil, malformed("non-terminated regular expression") } if len(rest) > 1 { -- GitLab