[libc-commits] [libc] [libc] fix behavior of strrchr(x, '\0') (PR #112620)

via libc-commits libc-commits at lists.llvm.org
Thu Oct 17 00:57:18 PDT 2024


================
@@ -114,25 +117,25 @@ template <auto Func> struct StrrchrTest : public LIBC_NAMESPACE::testing::Test {
     const char *src = "abcde";
 
     // Should return null terminator.
-    ASSERT_STREQ(Func(src, '\0'), "");
+    ASSERT_TRUE(Func(src, '\0') != nullptr);
----------------
JL2210 wrote:

maybe `Func(src, '\0') != nullptr && *Func(src, '\0') == '\0'`?

https://github.com/llvm/llvm-project/pull/112620


More information about the libc-commits mailing list