-// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
{
std::stringstream sstr;
sstr<<name<<'='<<value;
- if(rewrite || std::string(getenv(name)).length() == 0)
+ if(rewrite || getenv(name) == nullptr || std::string(getenv(name)).length() == 0)
return _putenv(sstr.str().c_str());
else return -1;
}