From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v4 10/20] eal/dev: implement device iteration Date: Mon, 9 Apr 2018 10:16:25 +0200 Message-ID: <20180409081625.amvkpxp2ctthsxg5@bidouze.vm.6wind.com> References: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: "dev@dpdk.org" To: Matan Azrad Return-path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id EBAD91B783 for ; Mon, 9 Apr 2018 10:16:39 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id s12so8372828wrc.8 for ; Mon, 09 Apr 2018 01:16:39 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Apr 09, 2018 at 07:28:00AM +0000, Matan Azrad wrote: > HI Gaetan > > From: Gaetan Rivet, Friday, March 30, 2018 12:24 AM > > +/* '\0' forbidden in sym */ > > +static const char * > > +strfirstof(const char *str, > > + const char *sym) > > +{ > > + const char *s; > > + > > + for (s = str; s[0] != '\0'; s++) { > > + const char *c; > > + > > + for (c = sym; c[0] != '\0'; c++) { > > + if (c[0] == s[0]) > > + return s; > > + } > > + } > > + return NULL; > > +} > > + > > I think you can use strcspn() instead... > Indeed, didn't know about it, I will change it. -- Gaëtan Rivet 6WIND