summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-15 02:15:54 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-15 23:30:30 -0500
commit746b39e4d1a41f248b71b91128f633c876116a79 (patch)
treede02fe9ac3a46885b9de623e2cba28d148f88606 /basic
parent1074c1ab9ee4aa537ea18a3128121ef591bd803f (diff)
Remove uses of pLine in scanner
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 51c7ed455a5a..5768ed44388e 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -398,7 +398,7 @@ bool SbiScanner::NextSym()
}
// Hex/octal number? Read in and convert:
- else if( *pLine == '&' )
+ else if(nCol < aLine.getLength() && aLine[nCol] == '&')
{
++pLine; ++nCol;
sal_Unicode cmp1[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F', 0 };
@@ -406,7 +406,8 @@ bool SbiScanner::NextSym()
sal_Unicode *cmp = cmp1;
sal_Unicode base = 16;
sal_Unicode ndig = 8;
- sal_Unicode xch = *pLine++ & 0xFF; ++nCol;
+ sal_Unicode xch = aLine[nCol] & 0xFF;
+ ++pLine; ++nCol;
switch( toupper( xch ) )
{
case 'O':
@@ -423,10 +424,10 @@ bool SbiScanner::NextSym()
long l = 0;
int i;
bool bBufOverflow = false;
- while( theBasicCharClass::get().isAlphaNumeric( *pLine & 0xFF, bCompatible ) )
+ while(nCol < aLine.getLength() && theBasicCharClass::get().isAlphaNumeric(aLine[nCol] & 0xFF, bCompatible))
{
sal_Unicode ch = sal::static_int_cast< sal_Unicode >(
- toupper( *pLine & 0xFF ) );
+ toupper(aLine[nCol] & 0xFF));
++pLine; ++nCol;
// from 4.1.1996: buffer full, go on scanning empty
if( (p-buf) == (BUF_SIZE-1) )
@@ -451,7 +452,7 @@ bool SbiScanner::NextSym()
GenError( SbERR_MATH_OVERFLOW ); break;
}
}
- if( *pLine == '&' ) ++pLine, ++nCol;
+ if(nCol < aLine.getLength() && aLine[nCol] == '&') ++pLine, ++nCol;
nVal = (double) l;
eScanType = ( l >= SbxMININT && l <= SbxMAXINT ) ? SbxINTEGER : SbxLONG;
if( bBufOverflow )