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.orig.lzh
/
libfake
/
strcspn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-27
|
420b
|
24 lines
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
int
strcspn(s, reject)
char *s;
char *reject;
{
register char *scan;
register char *rscan;
register int count;
count = 0;
for (scan = s; *scan != '\0'; scan++) {
for (rscan = reject; *rscan != '\0';) /* ++ moved down. */
if (*scan == *rscan++)
return(count);
count++;
}
return(count);
}