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

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Feb 28 11:55:23 PST 2023


sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/string/string_utils.h:169
   for (; *segment; ++segment)
-    bitset.set(*segment);
-  for (; *src && !bitset.test(*src); ++src)
+    bitset.set((uint8_t)*segment);
+  for (; *src && !bitset.test((uint8_t)*src); ++src)
----------------
I am guessing that you are seeing a signed vs unsigned problem? If yes, then may be `*reinterpret_cast<const unsigned char *>(segment)` ?


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

https://reviews.llvm.org/D144995



More information about the libc-commits mailing list