1*48654Sbostic /*- 2*48654Sbostic * Copyright (c) 1985 The Regents of the University of California. 3*48654Sbostic * All rights reserved. 4*48654Sbostic * 5*48654Sbostic * %sccs.include.proprietary.c% 6*48654Sbostic */ 7*48654Sbostic 813658Ssam #ifndef lint 9*48654Sbostic static char sccsid[] = "@(#)index.c 5.3 (Berkeley) 04/24/91"; 10*48654Sbostic #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 * 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