xref: /csrg-svn/lib/libc/string/strchr.c (revision 24155)
1*24155Skre #ifndef lint
2*24155Skre static char sccsid[] = "@(#)strchr.c	5.1 (Berkeley) 85/08/04";
3*24155Skre #endif not lint
4*24155Skre 
5*24155Skre /*
6*24155Skre  * Return the ptr in sp at which the character c appears;
7*24155Skre  * NULL if not found
8*24155Skre  *
9*24155Skre  * this routine is just "index" renamed.
10*24155Skre  */
11*24155Skre 
12*24155Skre #define	NULL	0
13*24155Skre 
14*24155Skre char *
15*24155Skre strchr(sp, c)
16*24155Skre register char *sp, c;
17*24155Skre {
18*24155Skre 	do {
19*24155Skre 		if (*sp == c)
20*24155Skre 			return(sp);
21*24155Skre 	} while (*sp++);
22*24155Skre 	return(NULL);
23*24155Skre }
24