mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Fix segfault when HOME not set
This commit is contained in:
parent
b627b3b4bb
commit
86114d32a7
1 changed files with 2 additions and 2 deletions
|
@ -278,8 +278,8 @@ namespace tools {
|
|||
// Non-windows: ~/.CRYPTONOTE_NAME
|
||||
fs::path get_default_data_dir()
|
||||
{
|
||||
std::string_view home{getenv("HOME")};
|
||||
return fs::u8path(!home.empty() ? home : "/"sv) / fs::u8path("." CRYPTONOTE_NAME);
|
||||
char* home = std::getenv("HOME");
|
||||
return fs::u8path(home && std::strlen(home) ? home : "/") / fs::u8path("." CRYPTONOTE_NAME);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue