From cb10d0bee9c62a096b1a3571d1d7e896e6864ecc Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 26 Sep 2025 22:54:12 -0400 Subject: libc: string: Add POSIX strnlen() Signed-off-by: Ian Moffett --- src/lib/libc/include/string.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/libc/include/string.h') diff --git a/src/lib/libc/include/string.h b/src/lib/libc/include/string.h index 83bb551..58a7caa 100644 --- a/src/lib/libc/include/string.h +++ b/src/lib/libc/include/string.h @@ -39,4 +39,13 @@ */ size_t strlen(const char *s); +/* + * Get the length of a string with a maximum + * length + * + * @s: String to check length of + * @maxlen: Max length of string to check + */ +size_t strnlen(const char *s, size_t maxlen); + #endif /* _STRING_H */ -- cgit v1.2.3