Commit 7b2b3be9 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

dialog: fix linux get home directory

parent 0dab7c67
......@@ -51,10 +51,10 @@ get_home_directory()
std::vector<char> buf(size, '\0');
struct passwd pwd;
struct passwd* result;
struct passwd* result = nullptr;
const auto s = getpwuid_r(getpid(), &pwd, buf.data(), size, &result);
if (!result)
if (s || !result)
return std::nullopt;
return std::filesystem::path{ std::string_view{ buf.data() } };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment