From d5e63a767ec05360cc7fdd974fe486140a1fa3cf Mon Sep 17 00:00:00 2001 From: greye Date: Thu, 26 Jul 2012 19:38:33 +0400 Subject: [PATCH] replace sprintf() with boost::format --- libs/openengine/bullet/physic.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 089825a9d..a778aef3a 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -11,6 +11,7 @@ #include "BtOgreExtras.h" #include +#include #define BIT(x) (1<<(x)) @@ -333,10 +334,8 @@ namespace Physic RigidBody* PhysicEngine::createRigidBody(std::string mesh,std::string name,float scale) { - char uniqueID[8]; - sprintf( uniqueID, "%07.3f", scale ); - std::string sid = uniqueID; - std::string outputstring = mesh + uniqueID; + std::string sid = (boost::format("%07.3f") % scale).str(); + std::string outputstring = mesh + sid; //std::cout << "The string" << outputstring << "\n"; //get the shape from the .nif @@ -571,10 +570,8 @@ namespace Physic void PhysicEngine::getObjectAABB(const std::string &mesh, float scale, btVector3 &min, btVector3 &max) { - char uniqueID[8]; - sprintf( uniqueID, "%07.3f", scale ); - std::string sid = uniqueID; - std::string outputstring = mesh + uniqueID; + std::string sid = (boost::format("%07.3f") % scale).str(); + std::string outputstring = mesh + sid; mShapeLoader->load(outputstring, "General"); BulletShapeManager::getSingletonPtr()->load(outputstring, "General");