Kaydet (Commit) 0aff4109 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

avoid 1-past-the-end string access

Change-Id: Ia475ce737c430fab8d019e1b8a762f81897e0847
üst 3e926736
...@@ -432,15 +432,14 @@ static sal_Int32 ImplPatternRightPos( const OUString& rStr, const OString& rEdit ...@@ -432,15 +432,14 @@ static sal_Int32 ImplPatternRightPos( const OUString& rStr, const OString& rEdit
{ {
// search non-literal successor // search non-literal successor
sal_Int32 nNewPos = nCursorPos; sal_Int32 nNewPos = nCursorPos;
sal_Int32 nTempPos = nNewPos; ;
while ( nTempPos < rEditMask.getLength() ) for(sal_Int32 nTempPos = nNewPos+1; nTempPos < rEditMask.getLength(); ++nTempPos )
{ {
if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL ) if ( rEditMask[nTempPos] != EDITMASK_LITERAL )
{ {
nNewPos = nTempPos+1; nNewPos = nTempPos;
break; break;
} }
nTempPos++;
} }
ImplPatternMaxPos( rStr, rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos ); ImplPatternMaxPos( rStr, rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
return nNewPos; return nNewPos;
......
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