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

Reply via email to