[dpdk-dev] [PATCH v4 10/20] eal/dev: implement device iteration
Matan Azrad
matan at mellanox.com
Mon Apr 9 09:28:00 CEST 2018
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...
More information about the dev
mailing list