|
@@ -493,12 +493,12 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
|
|
|
|
|
|
aiString szFile;
|
|
aiString szFile;
|
|
const size_t iLen = strlen((const char *)szCurrent);
|
|
const size_t iLen = strlen((const char *)szCurrent);
|
|
- size_t iLen2 = iLen + 1;
|
|
|
|
- iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2;
|
|
|
|
|
|
+ size_t iLen2 = iLen > MAXLEN - 1 ? MAXLEN - 1: iLen;
|
|
memcpy(szFile.data, (const char *)szCurrent, iLen2);
|
|
memcpy(szFile.data, (const char *)szCurrent, iLen2);
|
|
|
|
+ szFile.data[iLen2] = '\0';
|
|
szFile.length = static_cast<ai_uint32>(iLen2);
|
|
szFile.length = static_cast<ai_uint32>(iLen2);
|
|
|
|
|
|
- szCurrent += iLen2;
|
|
|
|
|
|
+ szCurrent += iLen2 + 1;
|
|
|
|
|
|
// place this as diffuse texture
|
|
// place this as diffuse texture
|
|
pcMatOut->AddProperty(&szFile, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
|
pcMatOut->AddProperty(&szFile, AI_MATKEY_TEXTURE_DIFFUSE(0));
|