home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
109.lha
/
PD_C
/
lib
/
strchr.c
< prev
next >
Wrap
Text File
|
1986-11-20
|
547b
|
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)
CONST char *s;
register char charwanted;
{
register CONST 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);
}