skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

byte_in.c (253B)


      1 /* ISC license. */
      2 
      3 #include <string.h>
      4 #include <skalibs/bytestr.h>
      5 
      6 size_t byte_in (char const *s, size_t n, char const *sep, size_t len)
      7 {
      8   char const *t = s ;
      9   while (n--)
     10   {
     11     if (memchr(sep, *t, len)) break ;
     12     ++t ;
     13   }
     14   return t - s ;
     15 }