|
@@ -211,7 +211,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
|
|
|
|
|
|
// Generate a default name for both the light source and the node
|
|
// Generate a default name for both the light source and the node
|
|
// FIXME - what's the right way to print a size_t? Is 'zu' universally available? stick with the safe version.
|
|
// FIXME - what's the right way to print a size_t? Is 'zu' universally available? stick with the safe version.
|
|
- light->mName.length = ::sprintf(light->mName.data,"ACLight_%i",static_cast<unsigned int>(mLights->size())-1);
|
|
|
|
|
|
+ light->mName.length = ::snprintf(light->mName.data, MAXLEN, "ACLight_%i",static_cast<unsigned int>(mLights->size())-1);
|
|
obj.name = std::string( light->mName.data );
|
|
obj.name = std::string( light->mName.data );
|
|
|
|
|
|
DefaultLogger::get()->debug("AC3D: Light source encountered");
|
|
DefaultLogger::get()->debug("AC3D: Light source encountered");
|
|
@@ -733,13 +733,13 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
|
|
switch (object.type)
|
|
switch (object.type)
|
|
{
|
|
{
|
|
case Object::Group:
|
|
case Object::Group:
|
|
- node->mName.length = ::sprintf(node->mName.data,"ACGroup_%i",groups++);
|
|
|
|
|
|
+ node->mName.length = ::snprintf(node->mName.data, MAXLEN, "ACGroup_%i",groups++);
|
|
break;
|
|
break;
|
|
case Object::Poly:
|
|
case Object::Poly:
|
|
- node->mName.length = ::sprintf(node->mName.data,"ACPoly_%i",polys++);
|
|
|
|
|
|
+ node->mName.length = ::snprintf(node->mName.data, MAXLEN, "ACPoly_%i",polys++);
|
|
break;
|
|
break;
|
|
case Object::Light:
|
|
case Object::Light:
|
|
- node->mName.length = ::sprintf(node->mName.data,"ACLight_%i",lights++);
|
|
|
|
|
|
+ node->mName.length = ::snprintf(node->mName.data, MAXLEN, "ACLight_%i",lights++);
|
|
break;
|
|
break;
|
|
|
|
|
|
// there shouldn't be more than one world, but we don't care
|
|
// there shouldn't be more than one world, but we don't care
|