Replaced unsafe strcpy

This commit is contained in:
Robert Osfield
2016-06-28 15:56:39 +01:00
parent 26da8fc9ce
commit 7f1ba5f7df
2 changed files with 6 additions and 3 deletions

View File

@@ -14,6 +14,7 @@
*/
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <stdlib.h>
#include <stdio.h>
@@ -538,7 +539,8 @@ void trpgrImageHelper::Init(trpgEndian inNess,char *inDir,
const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool sepGeoTyp)
{
ness = inNess;
strcpy(dir,inDir);
osgDB::stringcopyfixedsize(dir,inDir);
separateGeoTyp = sepGeoTyp;
matTable = &inMatTable;
texTable = &inTexTable;

View File

@@ -14,6 +14,7 @@
*/
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <stdlib.h>
#include <stdio.h>
@@ -593,8 +594,8 @@ trpgrAppFileCache::trpgrAppFileCache(const char *inPre,const char *inExt,int noF
void trpgrAppFileCache::Init(const char *inPre,const char *inExt,int noFiles)
{
strcpy(baseName,inPre);
strcpy(ext,inExt);
osgDB::stringcopyfixedsize(baseName,inPre);
osgDB::stringcopyfixedsize(ext,inExt);
files.resize(noFiles);
timeCount = 0;