X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcspn.c;h=c2db7ab32abc73b2bac4349ae1b868417875720e;hb=435127acb8e016352a581827aa0465a2b32824e6;hp=80c620cb03c8749e514c7d81caefd9372ce5a01b;hpb=d954dee1f991f0bc017ac65c4203c36c838abb1f;p=fw%2Fpdclib 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)); +} +*/