mirror of https://github.com/stella-emu/stella.git
Fix segfault.
This commit is contained in:
parent
ff7ac2de65
commit
81bc65bf56
|
@ -250,8 +250,9 @@ namespace BSPF
|
||||||
inline string getenv(const string& env_var)
|
inline string getenv(const string& env_var)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
string result(std::getenv(env_var.c_str()));
|
const char* val = std::getenv(env_var.c_str());
|
||||||
return result;
|
|
||||||
|
return val ? string(val) : EmptyString;
|
||||||
}
|
}
|
||||||
catch(...) {
|
catch(...) {
|
||||||
return EmptyString;
|
return EmptyString;
|
||||||
|
|
Loading…
Reference in New Issue