From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 04 Apr 2016 07:11:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,440,1455004800"; d="scan'208";a="925043421" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga001.jf.intel.com with ESMTP; 04 Apr 2016 07:11:55 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.19]) by IRSMSX108.ger.corp.intel.com ([169.254.11.13]) with mapi id 14.03.0248.002; Mon, 4 Apr 2016 15:11:53 +0100 From: "Azarewicz, PiotrX T" To: Olivier Matz CC: "dev@dpdk.org" Thread-Topic: [PATCH v1 1/1] cmdline: add any multi string mode to token string Thread-Index: AQHRjApDGHPLeZZNFkmXKiQx2oWojJ95Z1cAgABwSnA= 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> In-Reply-To: <57021F2E.8070306@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2016 14:11:58 -0000 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