From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: Re: [PATCH v4 10/20] eal/dev: implement device iteration Date: Mon, 9 Apr 2018 07:28:00 +0000 Message-ID: References: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: Gaetan Rivet , "dev@dpdk.org" Return-path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50087.outbound.protection.outlook.com [40.107.5.87]) by dpdk.org (Postfix) with ESMTP id 5CD581B719 for ; Mon, 9 Apr 2018 09:28:01 +0200 (CEST) In-Reply-To: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 =3D str; s[0] !=3D '\0'; s++) { > + const char *c; > + > + for (c =3D sym; c[0] !=3D '\0'; c++) { > + if (c[0] =3D=3D s[0]) > + return s; > + } > + } > + return NULL; > +} > + I think you can use strcspn() instead...