The error was that `argv' was incremented before passing it to
`argpar_iter_create'. However, the macro `SHOW_HELP' implicitly
deferences `argv[0]' to determine the command name.
Fix this by introducing a new variable `args' leaving `argv' untouched.
Change-Id: Id50fa2424550280a1e5e207429d643f5e8e00396
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
char *owner_uid = NULL;
long long uid;
struct mi_writer *mi_writer = NULL;
char *owner_uid = NULL;
long long uid;
struct mi_writer *mi_writer = NULL;
if (lttng_opt_mi) {
mi_writer = mi_lttng_writer_create(
if (lttng_opt_mi) {
mi_writer = mi_lttng_writer_create(
- argpar_iter = argpar_iter_create(argc, argv, remove_trigger_options);
+ argpar_iter = argpar_iter_create(argc - 1, args, remove_trigger_options);
if (!argpar_iter) {
ERR("Failed to allocate an argpar iter.");
goto error;
if (!argpar_iter) {
ERR("Failed to allocate an argpar iter.");
goto error;
while (true) {
enum parse_next_item_status status;
while (true) {
enum parse_next_item_status status;
- status = parse_next_item(argpar_iter, &argpar_item, 1, argv,
- true, NULL, NULL);
+ status = parse_next_item(argpar_iter, &argpar_item, 1, args,
+ true, NULL, NULL);
if (status == PARSE_NEXT_ITEM_STATUS_ERROR ||
status == PARSE_NEXT_ITEM_STATUS_ERROR_MEMORY) {
goto error;
if (status == PARSE_NEXT_ITEM_STATUS_ERROR ||
status == PARSE_NEXT_ITEM_STATUS_ERROR_MEMORY) {
goto error;