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