Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <string.h>
2
 
3
#define	N	256
4
 
5
size_t
6
strspn(const char *s, const char *b)
7
{
8
	char map[N], *os;
9
 
10
	memset(map, 0, N);
11
	while(*b)
12
		map[*(unsigned char *)b++] = 1;
13
	os = (char *)s;
14
	while(map[*(unsigned char *)s++])
15
		;
16
	return s - os - 1;
17
}