home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
STRCSPN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
530b
|
27 lines
/* from Henry Spencer's stringlib */
#include <string.h>
/*
* strcspn - find length of initial segment of s consisting entirely
* of characters not from reject
*/
size_t
strcspn(s, reject)
const char *s;
const char *reject;
{
register const char *scan;
register const char *rscan;
register size_t count;
count = 0;
for (scan = s; *scan != '\0'; scan++) {
for (rscan = reject; *rscan != '\0';) /* ++ moved down. */
if (*scan == *rscan++)
return(count);
count++;
}
return(count);
}