mirror of
https://github.com/diegocr/libnix.git
synced 2026-09-11 19:25:43 +00:00
14 lines
246 B
C
14 lines
246 B
C
#include <string.h>
|
|
|
|
size_t strcspn(const char *s1,const char *s2)
|
|
{ unsigned char *c2,*c1=(unsigned char *)s1;
|
|
size_t i;
|
|
for(i=0;;i++) {
|
|
c2=(unsigned char *)s2;
|
|
do
|
|
if(c1[i]==*c2)
|
|
return i;
|
|
while(*c2++!='\0');
|
|
}
|
|
}
|