mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
LibC: Implement wmemchr
This commit is contained in:
parent
5ac2e84264
commit
0ca1df4dc6
3 changed files with 43 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue