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...

Reply via email to