MCPcopy Create free account
hub / github.com/Artikash/Textractor / cpp_basic_strnlen

Function cpp_basic_strnlen

texthook/util/cpputil/cppcstring.h:25–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template <typename charT>
25inline size_t cpp_basic_strnlen(const charT *s, size_t n)
26{
27 const charT *p = s;
28 while (*p && n) p++, n--;
29 return p - s;
30}
31
32inline size_t cpp_strnlen(const char *s, size_t n) { return cpp_basic_strnlen<char>(s, n); }
33inline size_t cpp_wstrnlen(const wchar_t *s, size_t n) { return cpp_basic_strnlen<wchar_t>(s, n); }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected