mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-22 21:37:22 +00:00
LibC: Implement strchrnul()
This commit is contained in:
committed by
Andreas Kling
parent
ba9313111f
commit
a52b3e8f2a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user