projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92d3c32
)
[libc] Fix strspn
author
Alex Brachet
<abrachet@google.com>
Fri, 3 Mar 2023 19:51:46 +0000
(19:51 +0000)
committer
Alex Brachet
<abrachet@google.com>
Fri, 3 Mar 2023 19:51:46 +0000
(19:51 +0000)
libc/src/string/strspn.cpp
patch
|
blob
|
history
diff --git
a/libc/src/string/strspn.cpp
b/libc/src/string/strspn.cpp
index
60f16df
..
9580d1b
100644
(file)
--- 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<const unsigned char *>(segment));
+ for (; *src && bitset.test(*reinterpret_cast<const unsigned char *>(src));
+ ++src)
;
return src - initial;
}