#include size_t strnlen(char const *s, size_t n) { size_t i = 0; while(s[i] && i < n) i++; return i; }