diff --git a/libc/src/string/strspn.cpp b/libc/src/string/strspn.cpp index 60f16df8acb1e..9580d1bc403e8 100644 --- a/libc/src/string/strspn.cpp +++ b/libc/src/string/strspn.cpp @@ -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(segment)); + for (; *src && bitset.test(*reinterpret_cast(src)); + ++src) ; return src - initial; }