const char *end = memchr (string, '\0', maxlen); return end ? (size_t) (end - string) : maxlen;
size_t len = 0;  while (s[len] != '\0' && maxlen > 0) { if (s[++len] == '\0' || --maxlen == 0) return len; if (s[++len] == '\0' || --maxlen == 0) return len; if (s[++len] == '\0' || --maxlen == 0) return len; ++len; --maxlen; }  return len;
__strnlen (const char *string, size_t maxlen){  const char *end = memchr (string, '\0', maxlen);  return end ? (size_t) (end - string) : maxlen;}