1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

LibC: Implement wmemchr

This commit is contained in:
Tim Schumacher 2021-09-22 08:56:34 +00:00 committed by Brian Gianforcaro
parent 5ac2e84264
commit 0ca1df4dc6
3 changed files with 43 additions and 0 deletions

View file

@ -375,4 +375,14 @@ wchar_t* wcsstr(const wchar_t* haystack, const wchar_t* needle)
return nullptr;
}
wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n)
{
for (size_t i = 0; i < n; i++) {
if (s[i] == c)
return const_cast<wchar_t*>(&s[i]);
}
return nullptr;
}
}