ref: 3f7e54a705c0f7a6e6807285e00167f2af5e3d88
dir: /lib/c/strcspn.c/
#include <string.h>
#undef strcspn
size_t
strcspn(const char *s1, const char *s2)
{
char buf[128];
unsigned char ch;
size_t n;
memset(buf, 0, sizeof(buf));
while (ch = *s2++)
buf[ch] = 1;
for (n = 0; (ch = *s1++) && !buf[ch]; ++n)
;
return n;
}