Skip to content
Permalink
Browse files

do not use getenv_s

  • Loading branch information
vcloarec authored and nyalldawson committed Dec 18, 2020
1 parent 8f5583e commit 3dfbcf5046966dab845292358523f0a9d34cfe89
Showing with 1 addition and 14 deletions.
  1. +1 −14 external/mdal/mdal_utils.cpp
@@ -21,20 +21,7 @@ std::string MDAL::getEnvVar( const std::string &varname, const std::string &defa
if ( varname.empty() )
return std::string();

char *envVarC = nullptr;
#ifdef WIN32
size_t requiredSize = 0;
getenv_s( &requiredSize, NULL, 0, varname.c_str() );
if ( requiredSize != 0 )
{
envVarC = ( char * )malloc( requiredSize * sizeof( char ) );
getenv_s( &requiredSize, envVarC, requiredSize, varname.c_str() );
}
else
envVarC = nullptr;
#else
envVarC = getenv( varname.c_str() );
#endif
char *envVarC = getenv( varname.c_str() );

if ( !envVarC )
return defaultVal;

0 comments on commit 3dfbcf5

Please sign in to comment.
You can’t perform that action at this time.