cxx: add 'strchr()'

Fixes #4122
This commit is contained in:
Christian Prochaska 2021-04-04 21:21:31 +02:00 committed by Norman Feske
parent 23b21812dd
commit 84e4cbb54c

View File

@ -171,6 +171,21 @@ extern "C" char *strcat(char *, const char *)
}
extern "C" char *strchr(const char *s, int c)
{
while (*s != '\0') {
if (*s == c)
return (char*)s;
s++;
}
if (c == '\0')
return (char*)s;
return nullptr;
}
extern "C" int strncmp(const char *s1, const char *s2, size_t n)
{
return Genode::strcmp(s1, s2, n);