/************************************************************* * File: lib/index.c * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history */ #include "string.h" /************************************************************* * char *index(const char *s,int c) * returns ptr to 1st c in s, else 0 */ char *index(char *s,int c) { if (s == 0) return(0); for (;*s;s++) { if (*s == c) return(s); } return(0); }