1#define __CRT__NO_INLINE 2#include <string.h> 3 4size_t __cdecl strnlen (const char *s, size_t maxlen) 5{ 6 const char *s2 = s; 7 while ((size_t) (s2 - s) < maxlen && *s2) 8 ++s2; 9 return s2 - s; 10} 11