fix: add STRNLEN compatability macro

Older SunOS systems come without strnlen, add STRNLEN macro in line with
the other str* compat macros.
This commit is contained in:
Claes Nästén
2021-12-06 07:49:15 +01:00
parent 8fdf1b265d
commit 8f1fdbc54a
6 changed files with 21 additions and 2 deletions

View File

@@ -513,7 +513,7 @@ String cbuf_to_string(const char *buf, size_t size)
String cstrn_to_string(const char *str, size_t maxsize)
FUNC_ATTR_NONNULL_ALL
{
return cbuf_to_string(str, strnlen(str, maxsize));
return cbuf_to_string(str, STRNLEN(str, maxsize));
}
/// Creates a String using the given C string. Unlike