2.9BSD/usr/src/lib/c/gen/index.c

Compare this file to the similar file:
Show the results in this format:

/*	@(#)index.c	2.1	SCCS id keyword	*/
/*
 * Return the ptr in sp at which the character c appears;
 * NULL if not found
 */

#define	NULL	0

char *
index(sp, c)
register char *sp, c;
{
	do {
		if (*sp == c)
			return(sp);
	} while (*sp++);
	return(NULL);
}