git://scm.lunaixsky.com
/
lunaix-os.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
feat: provide some libc routines only for testing
[lunaix-os.git]
/
lunaix-os
/
libs
/
klibc
/
string
/
strlen.c
1
#include <klibc/string.h>
2
3
size_t
4
strlen(const char* str)
5
{
6
size_t len = 0;
7
while (str[len])
8
len++;
9
return len;
10
}
11
12
size_t
13
strnlen(const char* str, size_t max_len)
14
{
15
size_t len = 0;
16
while (str[len] && len <= max_len)
17
len++;
18
return len;
19
}