From f5a1ee4b2b6e9513f7229dffc66e70f434687627 Mon Sep 17 00:00:00 2001 From: liuerfire Date: Mon, 15 Jan 2024 20:50:16 +0800 Subject: [PATCH] Fix argv for subcommand --- trapit.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/trapit.cc b/trapit.cc index 9b449bb..66fec77 100644 --- a/trapit.cc +++ b/trapit.cc @@ -98,9 +98,8 @@ int cmd_trap(const char *prog, int argc, char **argv) noexcept { << " arguments, got " << argc << " arguments"; return 1; } else { - exec_argv[0] = argv[0]; for (int i = 0; i < argc; i++) { - exec_argv[i + 1] = argv[i]; + exec_argv[i] = argv[i]; } exec_argv[argc + 1] = NULL; }