diff options
author | Profpatsch <mail@profpatsch.de> | 2021-02-09T19·53+0100 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2021-02-13T20·00+0000 |
commit | 4d9e5d8e47e5bbf36027e244535cf0e7986add8e (patch) | |
tree | 76366008442522d10dfcc45830190563cdc1524e /users/Profpatsch | |
parent | 7bd43d15d90f05d752578ca14abc064e5f3db7af (diff) |
fix(users/Profpatsch/execline/exec_helpers): fix arg loop off-by-1 r/2203
Change-Id: If20a91eaa6693ba35ce645b104c625dbd0c71726 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2500 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users/Profpatsch')
-rw-r--r-- | users/Profpatsch/execline/exec_helpers.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/users/Profpatsch/execline/exec_helpers.rs b/users/Profpatsch/execline/exec_helpers.rs index 9a67ffe45db5..b0b0984911a5 100644 --- a/users/Profpatsch/execline/exec_helpers.rs +++ b/users/Profpatsch/execline/exec_helpers.rs @@ -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)) |