From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Azarewicz, PiotrX T" Subject: Re: [PATCH v1 1/1] cmdline: add any multi string mode to token string Date: Mon, 4 Apr 2016 14:11:52 +0000 Message-ID: <4837007523CC9A4B9414D20C13DE6E6413687FDB@IRSMSX102.ger.corp.intel.com> References: <1459510581-31392-1-git-send-email-piotrx.t.azarewicz@intel.com> <57021F2E.8070306@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Olivier Matz Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 94A132952 for ; Mon, 4 Apr 2016 16:11:57 +0200 (CEST) In-Reply-To: <57021F2E.8070306@6wind.com> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Monday, April 4, 2016 10:01 AM > To: Azarewicz, PiotrX T > Cc: dev@dpdk.org > Subject: Re: [PATCH v1 1/1] cmdline: add any multi string mode to token > string >=20 > Hi Piotr, >=20 > This is globally ok for me. Please see a comment below. >=20 Good to know it, thanks. > Using token_len + 1 as the buffer size in the snprintf looks a bit danger= ous, as > it won't protect from overflows. >=20 > See the following example: > That's why snprintf() should still use STR_TOKEN_SIZE. > Okay, I see it. But this is a problem that we may need longer string than STR_TOKEN_SIZE in= multi token case. So what you think about adding new typedef cmdline_multi_string_t for this = case? For example: #define STR_MULTI_TOKEN_SIZE 1024 typedef char cmdline_multi_string_t[STR_MULTI_TOKEN_SIZE]; >=20 > Regards, > Olivier