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 <u.h>
2
#include <libc.h>
3
 
4
char*
5
strchr(char *s, int c)
6
{
7
	char c0 = c;
8
	char c1;
9
 
10
	if(c == 0) {
11
		while(*s++)
12
			;
13
		return s-1;
14
	}
15
 
16
	while(c1 = *s++)
17
		if(c1 == c0)
18
			return s-1;
19
	return 0;
20
}