The current implementations of `strspn`, `strcspn`, and `strpbrk` appear to be incorrect and do not pass the following test cases: ```c char const * str = "abcdef"; char const * empty = ""; assert(strspn(str, empty) == 0); assert(strpbrk(str, empty) == NULL); assert(strcspn(str, empty) == 6); assert(strcspn(str, "cba") == 0); assert(strcspn(str, "fed") == 3); assert(strcspn(str, "eebbeb") == 1); assert(strcspn(str, "ffaafa") == 0); assert(strcspn(empty, str) == 0); assert(strcspn(empty, empty) == 0); ``` These issues have already been documented here: https://github.com/CE-Programming/toolchain/issues/646 There are also corrected implementations available in the CE Programming toolchain.
Activity