sprintf replacement: introduce au_snprintf to support snprintf for v2013
and earier ( closes https://github.com/assimp/assimp/issues/743 )
This commit is contained in:
@@ -181,7 +181,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
const unsigned int idx = aiMappingTable[p];
|
||||
if (ppcMaterials[idx]) {
|
||||
aiString sz;
|
||||
sz.length = ::sprintf(sz.data,"JoinedMaterial_#%u",p);
|
||||
sz.length = ::ai_snprintf(sz.data,MAXLEN,"JoinedMaterial_#%u",p);
|
||||
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
} else {
|
||||
ppcMaterials[idx] = pScene->mMaterials[p];
|
||||
@@ -209,7 +209,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
else
|
||||
{
|
||||
char szBuffer[128]; // should be sufficiently large
|
||||
::sprintf(szBuffer,"RemoveRedundantMatsProcess finished. Removed %u redundant and %u unused materials.",
|
||||
::ai_snprintf(szBuffer,128,"RemoveRedundantMatsProcess finished. Removed %u redundant and %u unused materials.",
|
||||
redundantRemoved,unreferencedRemoved);
|
||||
DefaultLogger::get()->info(szBuffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user