Skip to content

Commit

Permalink
[libc] Fix strspn
Browse files Browse the repository at this point in the history
  • Loading branch information
abrachet committed Mar 3, 2023
1 parent 92d3c32 commit 96ff212
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libc/src/string/strspn.cpp
Expand Up @@ -19,8 +19,9 @@ LLVM_LIBC_FUNCTION(size_t, strspn, (const char *src, const char *segment)) {
cpp::bitset<256> bitset;

for (; *segment; ++segment)
bitset.set(*segment);
for (; *src && bitset.test(*src); ++src)
bitset.set(*reinterpret_cast<const unsigned char *>(segment));
for (; *src && bitset.test(*reinterpret_cast<const unsigned char *>(src));
++src)
;
return src - initial;
}
Expand Down

0 comments on commit 96ff212

Please sign in to comment.