diff --git a/code/AssetLib/MS3D/MS3DLoader.cpp b/code/AssetLib/MS3D/MS3DLoader.cpp index 7b42a2526..057b9cba8 100644 --- a/code/AssetLib/MS3D/MS3DLoader.cpp +++ b/code/AssetLib/MS3D/MS3DLoader.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2025, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -46,10 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Written against http://chumbalum.swissquake.ch/ms3d/ms3dspec.txt */ - #ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER -// internal headers #include "MS3DLoader.h" #include #include @@ -392,13 +388,14 @@ void MS3DImporter::InternReadFile( const std::string& pFile, if (need_default && materials.size()) { ASSIMP_LOG_WARN("MS3D: Found group with no material assigned, spawning default material"); - // if one of the groups has no material assigned, but there are other + // if one of the groups has no material assigned, but there are other // groups with materials, a default material needs to be added ( // scenepreprocessor adds a default material only if nummat==0). materials.emplace_back(); TempMaterial& m = materials.back(); - - strcpy(m.name,""); + constexpr char DefaultMat[18] = ""; + strncpy(m.name, DefaultMat, sizeof(m.name)); + m.name[18]='\0'; m.diffuse = aiColor4D(0.6f,0.6f,0.6f,1.0); m.transparency = 1.f; m.shininess = 0.f;