summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sal/osl/unx/security.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index c440de1bf3e1..c2f355611eae 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -322,13 +322,12 @@ static bool osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal
#endif
if (pStr != nullptr && strlen(pStr) > 0 && access(pStr, 0) == 0)
+ {
strncpy(pszDirectory, pStr, nMax);
- else if (pSecImpl->m_pPasswd.pw_dir != nullptr)
- strncpy(pszDirectory, pSecImpl->m_pPasswd.pw_dir, nMax);
- else
- return false;
+ return true;
+ }
}
- else if (pSecImpl->m_pPasswd.pw_dir != nullptr)
+ if (pSecImpl->m_pPasswd.pw_dir != nullptr)
strncpy(pszDirectory, pSecImpl->m_pPasswd.pw_dir, nMax);
else
return false;