size_t strnlen(const char *s, size_t n);
strnlen returns the length of the string pointed to by s, up to a maximum of n characters. strnlen only examines the first n characters of the string s.
strnlen conforms to POSIX.1-2008.