mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Kernel: Add strncmp()
This commit is contained in:
parent
feabe6ed31
commit
2396b2ed70
Notes:
sideshowbarker
2024-07-19 12:45:20 +09:00
Author: https://github.com/bugaevc
Commit: 2396b2ed70
Pull-request: https://github.com/SerenityOS/serenity/pull/434
Reviewed-by: https://github.com/awesomekling
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