fts_load no longer has any return value
[unix-history] / usr / src / lib / libc / string / index.c
CommitLineData
550654be
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
ca063491
KB
3 * All rights reserved.
4 *
550654be 5 * %sccs.include.redist.c%
080609df
BJ
6 */
7
ca063491 8#if defined(LIBC_SCCS) && !defined(lint)
46b5f26a 9static char sccsid[] = "@(#)index.c 5.7 (Berkeley) %G%";
ca063491
KB
10#endif /* LIBC_SCCS and not lint */
11
46b5f26a 12#include <sys/cdefs.h>
550654be
KB
13#include <string.h>
14#include <stddef.h>
080609df
BJ
15
16char *
f61c2fd8
KB
17#ifdef STRCHR
18strchr(p, ch)
19#else
ca063491 20index(p, ch)
f61c2fd8 21#endif
46b5f26a 22 register const char *p, ch;
080609df 23{
ca063491
KB
24 for (;; ++p) {
25 if (*p == ch)
46b5f26a 26 return((char *)p);
ca063491
KB
27 if (!*p)
28 return((char *)NULL);
29 }
30 /* NOTREACHED */
080609df 31}