mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
Kernel: Add strncmp()
This commit is contained in:
parent
feabe6ed31
commit
2396b2ed70
2 changed files with 9 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue