mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
flag: fix array boundary check
This commit is contained in:
parent
efb45579aa
commit
7a92a47eb3
@ -156,7 +156,7 @@ fn (fs mut FlagParser) parse_value(longhand string, shorthand byte) []string {
|
||||
continue
|
||||
}
|
||||
if (arg.len == 2 && arg[0] == `-` && arg[1] == shorthand ) || arg == full {
|
||||
if i+1 > fs.args.len {
|
||||
if i+1 >= fs.args.len {
|
||||
panic("Missing argument for '$longhand'")
|
||||
}
|
||||
nextarg := fs.args[i+1]
|
||||
|
Loading…
Reference in New Issue
Block a user