7
#define ALIGN (sizeof(size_t))
8
#define ONES ((size_t)-1/UCHAR_MAX)
9
#define HIGHS (ONES * (UCHAR_MAX/2+1))
10
#define HASZERO(x) ((x)-ONES & ~(x) & HIGHS)
12
char *__strchrnul(const char *s, int c)
17
if (!c) return (char *)s + strlen(s);
19
for (; (uintptr_t)s % ALIGN; s++)
20
if (!*s || *(unsigned char *)s == c) return (char *)s;
22
for (w = (void *)s; !HASZERO(*w) && !HASZERO(*w^k); w++);
23
for (s = (void *)w; *s && *(unsigned char *)s != c; s++);
27
weak_alias(__strchrnul, strchrnul);