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