GH680: Reuse strnlen() in strndup()