[libc-commits] [PATCH] D144995: [libc] Fix strcspn

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 1 10:58:06 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc891ef6ca014: [libc] Fix strcspn (authored by abrachet).
Herald added a project: libc-project.

Changed prior to commit:
  https://reviews.llvm.org/D144995?vs=501243&id=501585#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144995/new/

https://reviews.llvm.org/D144995

Files:
  libc/src/string/string_utils.h


Index: libc/src/string/string_utils.h
===================================================================
--- libc/src/string/string_utils.h
+++ libc/src/string/string_utils.h
@@ -166,8 +166,9 @@
   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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144995.501585.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230301/0bcd7a1b/attachment.bin>


More information about the libc-commits mailing list