summaryrefslogtreecommitdiff
path: root/sal/osl/unx/security.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-16 10:45:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-16 13:08:28 +0100
commit4828debf7b4fa19bc26e2a02e5606d2c07b4c5d2 (patch)
treeb93d14373ea652e634847d31cb73d70febd862be /sal/osl/unx/security.cxx
parenta0e326f5e109a1dc3402b4102ad730de6feeba96 (diff)
New loplugin:empty
Change-Id: I8729db064573ac21dfe6b203c5ae244d79ecc4fe Reviewed-on: https://gerrit.libreoffice.org/66430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal/osl/unx/security.cxx')
-rw-r--r--sal/osl/unx/security.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index 29897d8e75de..982b7c940c2f 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -320,7 +320,7 @@ static bool osl_psz_getHomeDir(oslSecurity Security, OString* pszDirectory)
pStr = getenv("HOME");
#endif
- if (pStr != nullptr && strlen(pStr) > 0 && access(pStr, 0) == 0)
+ if (pStr != nullptr && pStr[0] != '\0' && access(pStr, 0) == 0)
{
auto const len = std::strlen(pStr);
if (len > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
@@ -389,7 +389,7 @@ static bool osl_psz_getConfigDir(oslSecurity Security, OString* pszDirectory)
sal_Char *pStr = getenv("XDG_CONFIG_HOME");
- if (pStr == nullptr || strlen(pStr) == 0 || access(pStr, 0) != 0)
+ if (pStr == nullptr || pStr[0] == '\0' || access(pStr, 0) != 0)
{
// a default equal to $HOME/.config should be used.
OString home;