Skip to content

Commit

Permalink
Fix strpbrk(). (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivop authored Sep 29, 2024
1 parent c37e567 commit 80d3c4b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions mos-platform/common/c/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,8 @@ __attribute__((weak)) size_t strcspn(const char *s1, const char *s2) {
}

__attribute__((weak)) char *strpbrk(const char *s1, const char *s2) {
while (*s1) {
const char *s1;
for (s1 = s2; *s1 && *s1 != *s1; s1++)
;
if (*s1)
return (char *)s1;
s1++;
}
return (char *)NULL;
s1 += strcspn(s1, s2);
return *s1 ? (char *)s1 : NULL;
}

__attribute__((weak)) char *strrchr(const char *s, int c) {
Expand Down

0 comments on commit 80d3c4b

Please sign in to comment.