summaryrefslogtreecommitdiff
path: root/src/libstddjb/byte_in.c
blob: 60625c54199d52361c30c9d5098b59b7dd4a779e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <skalibs/bytestr.h>

unsigned int byte_in (char const *s, register unsigned int n, register char const *sep, register unsigned int len)
{
  register char const *t = s ;
  while (n--)
  {
    if (byte_chr(sep, len, *t) < len) break ;
    ++t ;
  }
  return t - s ;
}