X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcspn.c;h=c2db7ab32abc73b2bac4349ae1b868417875720e;hb=3a9e76c71c4cb227c55c560d17678041cabb14d2;hp=80c620cb03c8749e514c7d81caefd9372ce5a01b;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strcspn.c b/functions/string/strcspn.c index 80c620c..c2db7ab 100644 --- a/functions/string/strcspn.c +++ b/functions/string/strcspn.c @@ -6,3 +6,23 @@ // ---------------------------------------------------------------------------- size_t strcspn( const char * s1, const char * s2 ) { /* TODO */ }; + +/* PDPC code - unreviewed +{ + const char *p1; + const char *p2; + + p1 = s1; + while (*p1 != '\0') + { + p2 = s2; + while (*p2 != '\0') + { + if (*p1 == *p2) return ((size_t)(p1 - s1)); + p2++; + } + p1++; + } + return ((size_t)(p1 - s1)); +} +*/