ref: 466cf20d3524b8e42edc333a6d2df2a01e99a95b dir: /sys/src/ape/lib/ap/gen/strnlen.c/
#include <string.h> size_t strnlen(const char *s, size_t maxlen) { size_t i; for (i = 0; i < maxlen && s[i] != '\0'; i++) ; return i; }