xref: /csrg-svn/usr.bin/uucp/port/index.c (revision 62391)
148654Sbostic /*-
2*62391Sbostic  * Copyright (c) 1985, 1993
3*62391Sbostic  *	The Regents of the University of California.  All rights reserved.
448654Sbostic  *
548654Sbostic  * %sccs.include.proprietary.c%
648654Sbostic  */
748654Sbostic 
813658Ssam #ifndef lint
9*62391Sbostic static char sccsid[] = "@(#)index.c	8.1 (Berkeley) 06/06/93";
1048654Sbostic #endif /* not lint */
1113658Ssam 
1213658Ssam #include <stdio.h>
1313658Ssam 
1417835Sralph /*
1517835Sralph  *	return pointer to character c
1613658Ssam  *
1713658Ssam  *	return codes:
1813658Ssam  *		NULL  -  character not found
1913658Ssam  *		pointer  -  pointer to character
2013658Ssam  */
2113658Ssam 
2213658Ssam char *
index(str,c)2313658Ssam index(str, c)
2413658Ssam register char c, *str;
2513658Ssam {
2613658Ssam 	for (; *str != '\0'; str++) {
2713658Ssam 		if (*str == c)
2817835Sralph 			return str;
2913658Ssam 	}
3013658Ssam 
3117835Sralph 	return NULL;
3213658Ssam }
33