Fix argument length checks (#1595)
This commit is contained in:
parent
dd4fd5dc9c
commit
8ac1a786dd
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user