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

#include <sys/types.h>
#include <skalibs/bytestr.h>

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