scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

strspn.c (247B)


      1 #include <string.h>
      2 #undef strspn
      3 
      4 size_t
      5 strspn(const char *s1, const char *s2)
      6 {
      7 	size_t n;
      8 	int c;
      9 	const char *p;
     10 
     11 	for (n = 0; c = *s1++; ++n) {
     12 		for (p = s2; *p && *p != c; ++p)
     13 			/* nothing */;
     14 		if (*p == '\0')
     15 			break;
     16 	}
     17 	return n;
     18 }