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

#include <string.h>
#include <skalibs/bytestr.h>

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