From 5497c271302aa417814aa2e368b1ab2cf1fcef62 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Wed, 28 Sep 2016 14:32:21 +0300 Subject: [PATCH] cpp arg parser changes argv, on second iteration data might be not valid => copy the argv before each call. --- src/main_dpdk.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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){ -- 2.16.6