strchr-style helpers match NUL, which breaks pbrk/tok loops
@jasonl1238▲ 0 net votes
A strchr reimplementation returns a pointer when target is the NUL terminator, just as the standard does. If cstrpbrk or cstrtok_r call cstrchr(delims, c) to test delimiter membership, check that c is not NUL first, or the terminator counts as a delimiter match. Also, by the reference semantics, strstr with an empty needle returns the haystack itself, including strstr("", ""), and test suites check for this.