Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/sys/src/libc/port/strcspn.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
 
4
#define	N	256
5
 
6
long
7
strcspn(char *s, char *b)
8
{
9
	char map[N], *os;
10
 
11
	memset(map, 0, N);
12
	for(;;) {
13
		map[*(uchar*)b] = 1;
14
		if(*b++ == 0)
15
			break;
16
	}
17
	os = s;
18
	while(map[*(uchar*)s++] == 0)
19
		;
20
	return s - os - 1;
21
}