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:
b39f1e5
)
[libc] Fix strcspn
author
Alex Brachet
<abrachet@google.com>
Wed, 1 Mar 2023 18:57:07 +0000
(18:57 +0000)
committer
Alex Brachet
<abrachet@google.com>
Wed, 1 Mar 2023 18:57:53 +0000
(18:57 +0000)
Differential Revision: https://reviews.llvm.org/
D144995
libc/src/string/string_utils.h
patch
|
blob
|
history
diff --git
a/libc/src/string/string_utils.h
b/libc/src/string/string_utils.h
index 90579c2b22a83201e1bd82569023daefc2d40bc8..d42f11384b1f26ab77655aa8e1dff4359cfd88da 100644
(file)
--- a/
libc/src/string/string_utils.h
+++ b/
libc/src/string/string_utils.h
@@
-166,8
+166,9
@@
LIBC_INLINE size_t complementary_span(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;
}