ATLAS Offline Software
Functions
SCT_ConditionsAlgorithms::CoveritySafe Namespace Reference

Functions

std::string getenv (const std::string &variableName)
 get an environment variable More...
 

Function Documentation

◆ getenv()

std::string SCT_ConditionsAlgorithms::CoveritySafe::getenv ( const std::string &  variableName)

get an environment variable

'getenv' which avoids possibly dereferencing a null pointer

Definition at line 17 of file SCT_ConditionsUtilities.cxx.

17  {
18  std::string result;
19  const char* pChar{std::getenv(variableName.c_str())};
20  if (pChar) result=pChar;
21  return result;
22  }
get_generator_info.result
result
Definition: get_generator_info.py:21
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17