mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-20 22:55:03 +00:00
LibC: Implement various things to get GNU bc building and running.
Looks like that's all we needed, and bc now runs. :^)
This commit is contained in:
@@ -186,6 +186,17 @@ char* strchr(const char* str, int c)
|
||||
}
|
||||
}
|
||||
|
||||
void* memchr(const void* ptr, int c, size_t size)
|
||||
{
|
||||
char ch = c;
|
||||
char* cptr = (char*)ptr;
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
if (cptr[i] == ch)
|
||||
return cptr + i;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char* strrchr(const char* str, int ch)
|
||||
{
|
||||
char *last = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user