ref: 3f7e54a705c0f7a6e6807285e00167f2af5e3d88 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; }