Fix argument length checks (#1595)

This commit is contained in:
dpapastamos 2019-07-01 19:10:09 +01:00 committed by Derek Parker
parent dd4fd5dc9c
commit 8ac1a786dd
2 changed files with 2 additions and 2 deletions

@ -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' {

@ -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 {