ref: 8e212d00e17c23b79489215d6cc41da22381a550 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; }