Kaydet (Commit) 85ee924f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

USHRT_MAX -> SAL_MAX_UINT16

nCount apparently must fit into sal_uInt16 for the cast further down when
passing it into ScAppOptions::SetLRUFuncList sal_uInt16 nCount parameter.  (But
why the odd "nCount < SAL_MAX_UINT16" vs. "nCount <= SAL_MAX_UINT16" off-by-one?
Oh, my.)

Change-Id: I231f4af2ce2e6bf44db8db3fd9e965adfa17fecb
Reviewed-on: https://gerrit.libreoffice.org/48838Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst f104fb0b
...@@ -131,7 +131,7 @@ static void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) ...@@ -131,7 +131,7 @@ static void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue )
if ( rValue >>= aSeq ) if ( rValue >>= aSeq )
{ {
sal_Int32 nCount = aSeq.getLength(); sal_Int32 nCount = aSeq.getLength();
if ( nCount < USHRT_MAX ) if ( nCount < SAL_MAX_UINT16 )
{ {
const sal_Int32* pArray = aSeq.getConstArray(); const sal_Int32* pArray = aSeq.getConstArray();
std::unique_ptr<sal_uInt16[]> pUShorts(new sal_uInt16[nCount]); std::unique_ptr<sal_uInt16[]> pUShorts(new sal_uInt16[nCount]);
......
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