From 21354e62d4d410741be15919ffd8bcc0fe2d93b0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 Jun 2016 16:30:06 +0100 Subject: [PATCH] Replaced unsafe c string usage with std::stringstream --- src/osgPlugins/txp/ReaderWriterTXP.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/osgPlugins/txp/ReaderWriterTXP.cpp b/src/osgPlugins/txp/ReaderWriterTXP.cpp index aa36c5183..988051ad3 100644 --- a/src/osgPlugins/txp/ReaderWriterTXP.cpp +++ b/src/osgPlugins/txp/ReaderWriterTXP.cpp @@ -133,16 +133,9 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin if (asChildren) { - char pagedLODfile[1024]; - sprintf(pagedLODfile,"%s\\subtiles%d_%dx%d_%d", - archive->getDir(), - lod, - x, - y, - archive->getId()); - strcat(pagedLODfile, childrenInfoStr.c_str()); - strcat(pagedLODfile, ".txp"); + std::stringstream pagedLODfile; + pagedLODfile<getDir()<<"\\subtiles"<getId()< pagedLOD = new TXPPagedLOD; // note: use maximum(info.maxRange,1e7) as just maxRange would result in some corner tiles from being culled out. pagedLOD->addChild(tileContent.get(),info.minRange,osg::maximum(info.maxRange,1e7)); - pagedLOD->setFileName(1,pagedLODfile); + pagedLOD->setFileName(1,pagedLODfile.str()); pagedLOD->setRange(1,0,info.minRange); pagedLOD->setCenter(info.center); pagedLOD->setRadius(info.radius);