Skip to content

Commit 96ff212

Browse files
committed
[libc] Fix strspn
1 parent 92d3c32 commit 96ff212

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libc/src/string/strspn.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ LLVM_LIBC_FUNCTION(size_t, strspn, (const char *src, const char *segment)) {
1919
cpp::bitset<256> bitset;
2020

2121
for (; *segment; ++segment)
22-
bitset.set(*segment);
23-
for (; *src && bitset.test(*src); ++src)
22+
bitset.set(*reinterpret_cast<const unsigned char *>(segment));
23+
for (; *src && bitset.test(*reinterpret_cast<const unsigned char *>(src));
24+
++src)
2425
;
2526
return src - initial;
2627
}

0 commit comments

Comments
 (0)