From 96d3bd203faa74a1e897ce34f7fad6c5f7508b7f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 Jun 2016 16:33:13 +0100 Subject: [PATCH] Replaced unsafe string usage --- src/osgPlugins/bsp/VBSPReader.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/bsp/VBSPReader.cpp b/src/osgPlugins/bsp/VBSPReader.cpp index cb1f45664..907170951 100644 --- a/src/osgPlugins/bsp/VBSPReader.cpp +++ b/src/osgPlugins/bsp/VBSPReader.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -997,9 +998,10 @@ void VBSPReader::createScene() { // Get the texdata entry and texture name currentTexData = bsp_data->getTexData(i); - texName = bsp_data-> - getTexDataString(currentTexData.name_string_table_id).c_str(); - strcpy(currentTexName, texName); + texName = bsp_data->getTexDataString(currentTexData.name_string_table_id).c_str(); + + osgDB::stringcopyfixedsize(currentTexName, texName); + // See if this is referring to an environment mapped material (we don't // handle this yet) @@ -1015,7 +1017,7 @@ void VBSPReader::createScene() // Now, we're pointing at the path to the material itself, so copy // what we've got so far - strcpy(tempTex, mtlPtr); + osgDB::stringcopyfixedsize(tempTex, mtlPtr); // Now, we just need to trim the two or three cube map coordinates // from the end.