ref: 07c3fc899a4788187f52b99961c7ae1777201d5b dir: /lib/c/string/strnlen.c/
#include <string.h> #undef strnlen size_t strnlen(const char *s, size_t maxlen) { size_t n; for (n = 0; n < maxlen && *s++; ++n) ; return n; }