Moved getenv usage across to safer osg::getEnvVar() usage

This commit is contained in:
Robert Osfield
2017-11-01 17:38:33 +00:00
parent 0e7e06349e
commit 338b0e2b7b
6 changed files with 39 additions and 24 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osg/Notify>
#include <osg/ApplicationUsage>
#include <osg/EnvVar>
#include <osg/ref_ptr>
#include <string>
#include <stdlib.h>
@@ -140,9 +141,8 @@ struct NotifySingleton
_notifyLevel = osg::NOTICE; // Default value
char* OSGNOTIFYLEVEL=getenv("OSG_NOTIFY_LEVEL");
if (!OSGNOTIFYLEVEL) OSGNOTIFYLEVEL=getenv("OSGNOTIFYLEVEL");
if(OSGNOTIFYLEVEL)
std::string OSGNOTIFYLEVEL;
if(getEnvVar("OSG_NOTIFY_LEVEL", OSGNOTIFYLEVEL) || getEnvVar("OSGNOTIFYLEVEL", OSGNOTIFYLEVEL))
{
std::string stringOSGNOTIFYLEVEL(OSGNOTIFYLEVEL);