diff options
| author | Jessica Clarke <jrtc27@jrtc27.com> | 2025-07-30 17:10:46 +0100 |
|---|---|---|
| committer | Jessica Clarke <jrtc27@jrtc27.com> | 2025-07-30 17:10:46 +0100 |
| commit | 66393c8ec645d9121f2b3e53708b0379a113aa02 (patch) | |
| tree | f2a740bc8ada2dde8506ea87bb6014a9b3722433 /libc/src/wchar/wcschr.cpp | |
| parent | 7e3a1d92899336f57a6af737c9641468a1dd19b3 (diff) | |
| parent | 3e93964b896023b1006d3c878effb68203d4d8dd (diff) | |
Created using spr 1.3.5
Diffstat (limited to 'libc/src/wchar/wcschr.cpp')
| -rw-r--r-- | libc/src/wchar/wcschr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/src/wchar/wcschr.cpp b/libc/src/wchar/wcschr.cpp index defc2ce3c3b7..8ac491602a65 100644 --- a/libc/src/wchar/wcschr.cpp +++ b/libc/src/wchar/wcschr.cpp @@ -11,15 +11,14 @@ #include "hdr/types/wchar_t.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" +#include "src/__support/macros/null_check.h" +#include "wchar_utils.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(const wchar_t *, wcschr, (const wchar_t *s, wchar_t c)) { - for (; *s && *s != c; ++s) - ; - if (*s == c) - return s; - return nullptr; + LIBC_CRASH_ON_NULLPTR(s); + return internal::wcschr(s, c); } } // namespace LIBC_NAMESPACE_DECL |
