blob: bf0cf52e49d0b1dd98b2cbf6e5938c34a3ec265e (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
/* ISC license. */
#include <sys/types.h>
#include <string.h>
#include <skalibs/bytestr.h>
size_t byte_chr (char const *s, size_t n, int c)
{
void *p = memchr(s, c, n) ;
return p ? (char *)p - s : n ;
}
|