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

LibC: Implement strchrnul()

This commit is contained in:
Shannon Booth 2020-02-15 10:58:36 +13:00 committed by Andreas Kling
parent ba9313111f
commit a52b3e8f2a
2 changed files with 10 additions and 0 deletions

View file

@ -297,6 +297,15 @@ char* strchr(const char* str, int c)
}
}
char* strchrnul(const char* str, int c)
{
char ch = c;
for (;; ++str) {
if (*str == ch || !*str)
return const_cast<char*>(str);
}
}
void* memchr(const void* ptr, int c, size_t size)
{
char ch = c;