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/planix-v0/sys/src/libc/port/memchr.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
void*
5
memchr(void *ap, int c, ulong n)
6
{
7
	uchar *sp;
8
 
9
	sp = ap;
10
	c &= 0xFF;
11
	while(n > 0) {
12
		if(*sp++ == c)
13
			return sp-1;
14
		n--;
15
	}
16
	return 0;
17
}