summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/comp/scanner.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index ff6b018cda28..0c359c5c7d3a 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -219,12 +219,10 @@ bool SbiScanner::NextSym()
sal_Int32 nOldCol1 = nCol1;
sal_Int32 nOldCol2 = nCol2;
sal_Unicode buf[ BUF_SIZE ], *p = buf;
- bHash = false;
eScanType = SbxVARIANT;
aSym = ::rtl::OUString();
- bSymbol =
- bNumber = bSpaces = false;
+ bHash = bSymbol = bNumber = bSpaces = false;
// read in line?
if( !pLine )
@@ -236,7 +234,7 @@ bool SbiScanner::NextSym()
nOldCol1 = nOldCol2 = 0;
}
- while( theBasicCharClass::get().isWhitespace( *pLine ) )
+ while(nCol < aLine.getLength() && theBasicCharClass::get().isWhitespace(aLine[nCol]))
++pLine, ++nCol, bSpaces = true;
nCol1 = nCol;
@@ -256,7 +254,7 @@ bool SbiScanner::NextSym()
}
// copy character if symbol
- if( theBasicCharClass::get().isAlpha( *pLine, bCompatible ) || *pLine == '_' )
+ if(nCol < aLine.getLength() && (theBasicCharClass::get().isAlpha(aLine[nCol], bCompatible) || aLine[nCol] == '_'))
{
// if there's nothing behind '_' , it's the end of a line!
if( *pLine == '_' && !*(pLine+1) )