Files
Arquivotheca.SunOS-4.1.4/lib/libc/gen/common/memchr.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

20 lines
390 B
C

#if !defined(lint) && defined(SCCSIDS)
static char sccsid[] = "@(#)memchr.c 1.1 94/10/31 SMI"; /* from S5R2 1.1 */
#endif
/*LINTLIBRARY*/
/*
* Return the ptr in sp at which the character c appears;
* NULL if not found in n chars; don't stop at \0.
*/
char *
memchr(sp, c, n)
register char *sp, c;
register int n;
{
while (--n >= 0)
if (*sp++ == c)
return (--sp);
return (0);
}