Fix SonarCloud security hotspot use of strncopy