Only Windows has strnlen_s.
authorElliott Hughes <enh@google.com>
Sat, 8 Oct 2016 18:13:40 +0000 (11:13 -0700)
committerElliott Hughes <enh@google.com>
Sat, 8 Oct 2016 18:13:40 +0000 (11:13 -0700)
commit49306465b5a5312058e9ae52b85fafc42e14f0c6
treeb74f20c31bda8f0b76f9875301d04007a0951d95
parent2f2ce0f048ce29faab4856087602f797f6cbfe22
Only Windows has strnlen_s.

The right way to ask for and check for strnlen_s on non-Windows would be:

  As with all bounds-checked functions, strnlen_s is only guaranteed to be
  available if __STDC_LIB_EXT1__ is defined by the implementation and if
  the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before
  including string.h.
    http://en.cppreference.com/w/c/string/byte/strlen

...but only Windows has any of this stuff. Android, Linux, and Mac OS all
don't. They do all have the POSIX 2008 strnlen(3), which is the same function
with a different name, but an earlier change deliberately replaced a call to
strnlen(3) with the current hand-written unoptimized implementation.

Bug: http://b/32019064
Test: builds
Change-Id: I4b5516b6438fe8ef3425c54d2bcddbdbb09b1814
framework/delibs/debase/deString.c