summaryrefslogtreecommitdiffstats
path: root/sal/osl/unx/security.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl/unx/security.cxx')
-rw-r--r--sal/osl/unx/security.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index e0d0ad210ed1..bdd9db6b7b94 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -263,7 +263,7 @@ static bool osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal
OUSTRING_TO_OSTRING_CVTFLAGS);
if (pStrValue && pStrValue->length > 0)
{
- sal_Int32 nCopy = (sal_Int32)(nMax-1) < pStrValue->length ? (sal_Int32)(nMax-1) : pStrValue->length ;
+ sal_Int32 nCopy = (sal_Int32)std::min(nMax-1, pStrValue->length) ;
strncpy (pszDirectory, pStrValue->buffer, nCopy);
pszDirectory[nCopy] = '\0';
bRet = (std::size_t)pStrValue->length < nMax;