diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-01-15 16:39:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-01-15 21:48:19 +0100 |
commit | d479d1694897bdb2588f38c4d231220efb4eb229 (patch) | |
tree | 9b859ed299508775329ded50314eb3d90407d9f3 /sal | |
parent | 47834895ee8284b3e42c1436c1bb59c36fab5051 (diff) |
simplify duplicate code
Change-Id: Id3b2c0de16d2b6f7fd12dcdf6fc7354541ee0b61
Reviewed-on: https://gerrit.libreoffice.org/66396
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/security.cxx | 9 |
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; |