Skip to content

Commit b0492ab

Browse files
authored
[libc] Fix internal::wcschr() return type.
The exported function is using a similar white lie for convenience, so the internal function may as well rather than adding const casts.
1 parent bd309b5 commit b0492ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/wchar/wchar_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace LIBC_NAMESPACE_DECL {
1818
namespace internal {
1919

20-
LIBC_INLINE static wchar_t *wcschr(const wchar_t *s, wchar_t c) {
20+
LIBC_INLINE static const wchar_t *wcschr(const wchar_t *s, wchar_t c) {
2121
for (; *s && *s != c; ++s)
2222
;
2323
return (*s == c) ? s : nullptr;
@@ -29,7 +29,7 @@ LIBC_INLINE static size_t wcsspn(const wchar_t *s1, const wchar_t *s2,
2929
bool not_match_set) {
3030
size_t i = 0;
3131
for (; s1[i]; ++i) {
32-
bool in_set = wcschr(s1[i], s2);
32+
bool in_set = internal::wcschr(s2, s1[i]);
3333
if (in_set == not_match_set)
3434
return i;
3535
}

0 commit comments

Comments
 (0)