The compiler is too smart for nm_strndup_a(). The code is correct, suppress "-Wstringop-truncation" warning.