strndup and strnlen