[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-05 Thread Azarewicz, PiotrX T
Hi Olivier, > -Original Message- > From: Olivier Matz [mailto:olivier.matz at 6wind.com] > Sent: Monday, April 4, 2016 5:58 PM > >> Using token_len + 1 as the buffer size in the snprintf looks a bit > >> dangerous, as it won't protect from overflows. > >> > >> See the following example: >

[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-04 Thread Olivier Matz
Hi Piotr, On 04/04/2016 04:11 PM, Azarewicz, PiotrX T wrote: >> Using token_len + 1 as the buffer size in the snprintf looks a bit >> dangerous, as >> it won't protect from overflows. >> >> See the following example: > > > That's why snprintf() should still use STR_TOKEN_SIZE. >> > Okay, I see

[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-04 Thread Azarewicz, PiotrX T
Hi Olivier, > -Original Message- > From: Olivier Matz [mailto:olivier.matz at 6wind.com] > Sent: Monday, April 4, 2016 10:01 AM > To: Azarewicz, PiotrX T > Cc: dev at dpdk.org > Subject: Re: [PATCH v1 1/1] cmdline: add any multi string mode to token > string > > Hi Piotr, > > This is gl

[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-04 Thread Olivier Matz
Hi Piotr, This is globally ok for me. Please see a comment below. On 04/01/2016 01:36 PM, Piotr Azarewicz wrote: > @@ -162,12 +174,15 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, > const char *buf, void *res, > } > > if (res) { > - /* we are sure that token_le

[dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string

2016-04-01 Thread Piotr Azarewicz
While parsing token string there may be several modes: - fixed single string - multi-choice single string - any single string This patch add one more mode - any multi string. Signed-off-by: Piotr Azarewicz --- app/test/test_cmdline_string.c|9 --- lib/librte_cmdline/cmdline_