new addition for portability
[unix-history] / usr / src / lib / libc / string / strchr.c
CommitLineData
2ce81398
DS
1#if defined(LIBC_SCCS) && !defined(lint)
2static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09";
3#endif LIBC_SCCS and not lint
117fa619
RE
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
14char *
15strchr(sp, c)
16register char *sp, c;
17{
18 do {
19 if (*sp == c)
20 return(sp);
21 } while (*sp++);
22 return(NULL);
23}