home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.src.lzh
/
libfake
/
strchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1980-01-01
|
408b
|
22 lines
/*
* strchr - find first occurrence of a character in a string
*/
#define NULL 0
char * /* found char, or NULL if none */
strchr(s, charwanted)
char *s;
register char charwanted;
{
register char *scan;
/*
* The odd placement of the two tests is so NUL is findable.
*/
for (scan = s; *scan != charwanted;) /* ++ moved down for opt. */
if (*scan++ == '\0')
return(NULL);
return(scan);
}