home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d110
/
pdc.lha
/
Pdc
/
lib
/
strcspn.c
< prev
next >
Wrap
Text File
|
1987-10-28
|
597b
|
24 lines
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
SIZET
strcspn(s, reject)
CONST char *s;
CONST char *reject;
{
register CONST char *scan;
register CONST char *rscan;
register SIZET count;
count = 0;
for (scan = s; *scan != '\0'; scan++) {
for (rscan = reject; *rscan != '\0';) /* ++ moved down. */
if (*scan == *rscan++)
return(count);
count++;
}
return(count);
}