fix(users/Profpatsch/execline/exec_helpers): fix arg loop off-by-1

Change-Id: If20a91eaa6693ba35ce645b104c625dbd0c71726
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2500
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
Profpatsch 2021-02-09 20:53:28 +01:00
parent 7bd43d15d9
commit 4d9e5d8e47

View file

@ -9,7 +9,7 @@ pub fn args_for_exec(current_prog_name: &str, no_of_positional_args: usize) -> (
let mut args = args.map(|arg| arg.into_vec());
let mut pos_args = vec![];
// get positional args
for i in 1..no_of_positional_args {
for i in 1..no_of_positional_args+1 {
pos_args.push(
args.nth(0).expect(
&format!("{}: expects {} positional args, only got {}", current_prog_name, no_of_positional_args, i))