Kaydet (Commit) 521723b1 authored tarafından Caolán McNamara's avatar Caolán McNamara

move deref inside (laughable) nSecurityCount check

Change-Id: Idf9a83ffa80137967d8c77d7a9b5133529fc2858
üst b593c9c5
...@@ -76,10 +76,9 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount) ...@@ -76,10 +76,9 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount)
long nRetValue = 0; long nRetValue = 0;
while ( ( --nSecurityCount ) && ( ( *rBuf == ' ' ) || ( *rBuf == 0x9 ) ) ) while ( ( --nSecurityCount ) && ( ( *rBuf == ' ' ) || ( *rBuf == 0x9 ) ) )
rBuf++; rBuf++;
sal_uInt8 nByte = *rBuf; while ( nSecurityCount && ( *rBuf != ' ' ) && ( *rBuf != 0x9 ) && ( *rBuf != 0xd ) && ( *rBuf != 0xa ) )
while ( nSecurityCount && ( nByte != ' ' ) && ( nByte != 0x9 ) && ( nByte != 0xd ) && ( nByte != 0xa ) )
{ {
switch ( nByte ) switch ( *rBuf )
{ {
case '.' : case '.' :
// we'll only use the integer format // we'll only use the integer format
...@@ -89,17 +88,17 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount) ...@@ -89,17 +88,17 @@ static long ImplGetNumber(sal_uInt8* &rBuf, sal_uInt32& nSecurityCount)
bNegative = true; bNegative = true;
break; break;
default : default :
if ( ( nByte < '0' ) || ( nByte > '9' ) ) if ( ( *rBuf < '0' ) || ( *rBuf > '9' ) )
nSecurityCount = 1; // error parsing the bounding box values nSecurityCount = 1; // error parsing the bounding box values
else if ( bValid ) else if ( bValid )
{ {
nRetValue *= 10; nRetValue *= 10;
nRetValue += nByte - '0'; nRetValue += *rBuf - '0';
} }
break; break;
} }
nSecurityCount--; nSecurityCount--;
nByte = *(++rBuf); ++rBuf;
} }
if ( bNegative ) if ( bNegative )
nRetValue = -nRetValue; nRetValue = -nRetValue;
......
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