1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

Kernel: Add strncmp()

This commit is contained in:
Sergey Bugaev 2019-08-10 18:01:33 +03:00 committed by Andreas Kling
parent feabe6ed31
commit 2396b2ed70
2 changed files with 9 additions and 0 deletions

View file

@ -102,6 +102,14 @@ size_t strlen(const char* str)
return len;
}
size_t strnlen(const char* str, size_t maxlen)
{
size_t len = 0;
for (; len < maxlen && *str; str++)
len++;
return len;
}
int strcmp(const char* s1, const char* s2)
{
for (; *s1 == *s2; ++s1, ++s2) {