From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2652F3977 for ; Thu, 17 Jan 2019 12:00:25 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 03:00:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,488,1539673200"; d="scan'208";a="119220817" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.54]) by orsmga003.jf.intel.com with SMTP; 17 Jan 2019 03:00:23 -0800 Received: by (sSMTP sendmail emulation); Thu, 17 Jan 2019 11:00:22 +0000 Date: Thu, 17 Jan 2019 11:00:22 +0000 From: Bruce Richardson To: "Burakov, Anatoly" Cc: dev@dpdk.org Message-ID: <20190117110022.GB289580@bricha3-MOBL.ger.corp.intel.com> References: <20190116124836.40132-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Subject: Re: [dpdk-dev] [PATCH] eal: support strlcat function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2019 11:00:26 -0000 On Thu, Jan 17, 2019 at 10:39:02AM +0000, Burakov, Anatoly wrote: > On 16-Jan-19 12:48 PM, Bruce Richardson wrote: > > Add the strlcat function to DPDK to exist alongside the strlcpy one. > > While strncat is generally safe for use for concatenation, the API for > > the strlcat function is perhaps a little nicer to use, and supports > > truncation detection. > > > > See commit: 5364de644a4b ("eal: support strlcpy function") for more > > details on the function selection logic, since we only should be using > > the DPDK-provided version when no system-provided version is present. > > > > Signed-off-by: Bruce Richardson --- > > <...> > > > static int test_string_fns(void) { if (test_rte_strsplit() < 0) > > return -1; + if (test_rte_strlcat() < 0) + return -1; > > return 0; } > > > > Unrelated, but do we also need to test strlcpy, strscpy and other > functions that were introduced? > Yes, I think that would be advisable. I imagine the easiest way to test them is to do as I have here in running comparisons with a range of inputs, especially boundary conditions, against a known-good version for platforms that have the functions built-in. As always, volunteers and patches welcome... :-) /Bruce