ref: 590ba0dfe7a73ab2e47fe333cf700e01d9cda6e9 dir: /lib/c/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; }