MDCLoader: Replace min and strlen with strnlen

pull/1647/head
Turo Lamminen 2017-12-19 18:46:48 +02:00
parent 65ffeaa81e
commit 0cf772a4d4
1 changed files with 2 additions and 2 deletions

View File

@ -294,8 +294,8 @@ void MDCImporter::InternReadFile(
pcMesh->mMaterialIndex = (unsigned int)aszShaders.size();
// create a new shader
aszShaders.push_back(std::string( pcShader->ucName, std::min(
::strlen(pcShader->ucName),sizeof(pcShader->ucName)) ));
aszShaders.push_back(std::string( pcShader->ucName,
::strnlen(pcShader->ucName, sizeof(pcShader->ucName)) ));
}
// need to create a default material
else if (UINT_MAX == iDefaultMatIndex)