From: Yaroslav Brustinov Date: Wed, 28 Sep 2016 11:32:21 +0000 (+0300) Subject: cpp arg parser changes argv, on second iteration data might be not valid => copy... X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=5497c271302aa417814aa2e368b1ab2cf1fcef62;p=trex.git cpp arg parser changes argv, on second iteration data might be not valid => copy the argv before each call. --- diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 8a92237d..e45e2abf 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -1071,6 +1071,21 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t return 0; } +static int parse_options_wrapper(int argc, char *argv[], CParserOption* po, bool first_time ) { + // copy, as arg parser sometimes changes the argv + char ** argv_copy = (char **) malloc(sizeof(char *) * argc); + for(int i=0; i 0){