xref: /csrg-svn/usr.bin/uucp/port/index.c (revision 13658)
1*13658Ssam #ifndef lint
2*13658Ssam static char sccsid[] = "@(#)index.c	5.1 (Berkeley) 07/02/83";
3*13658Ssam #endif
4*13658Ssam 
5*13658Ssam #include <stdio.h>
6*13658Ssam 
7*13658Ssam /*******
8*13658Ssam  *	char *
9*13658Ssam  *	index(str, c)	return pointer to character c
10*13658Ssam  *	char c, *str;
11*13658Ssam  *
12*13658Ssam  *	return codes:
13*13658Ssam  *		NULL  -  character not found
14*13658Ssam  *		pointer  -  pointer to character
15*13658Ssam  */
16*13658Ssam 
17*13658Ssam char *
18*13658Ssam index(str, c)
19*13658Ssam register char c, *str;
20*13658Ssam {
21*13658Ssam 	for (; *str != '\0'; str++) {
22*13658Ssam 		if (*str == c)
23*13658Ssam 			return(str);
24*13658Ssam 	}
25*13658Ssam 
26*13658Ssam 	return(NULL);
27*13658Ssam }
28