diff options
Diffstat (limited to 'tools/include/nolibc/string.h')
-rw-r--r-- | tools/include/nolibc/string.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index 75a453870498..f43d52a44d09 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -148,6 +148,15 @@ size_t nolibc_strlen(const char *str) #endif static __attribute__((unused)) +size_t strnlen(const char *str, size_t maxlen) +{ + size_t len; + + for (len = 0; (len < maxlen) && str[len]; len++); + return len; +} + +static __attribute__((unused)) size_t strlcat(char *dst, const char *src, size_t size) { size_t len; |