summaryrefslogtreecommitdiff
path: root/basic/source/comp/scanner.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-21 09:53:57 +0200
committerNoel Grandin <noel@peralex.com>2013-10-23 13:12:55 +0200
commit8396cce9b5d9a4e3cdccc558eb1b818460f0987a (patch)
treec573d21f50405516245cbfc11630c589a098a855 /basic/source/comp/scanner.cxx
parent763114f8b7a7705e1b28226da33bf00016ad7982 (diff)
clean up places accessing the NULL at the of an OUString
There were only a couple of real bugs fixed, but we're a little bit safer now. This also fixes the assert and the comment in OUString::operator[] about this. Change-Id: Ibe16b5794e0ba7ecd345fa0801586d25b015974c
Diffstat (limited to 'basic/source/comp/scanner.cxx')
-rw-r--r--basic/source/comp/scanner.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 0a5a4932f99f..3609765b3630 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -401,13 +401,16 @@ bool SbiScanner::NextSym()
GenError( SbERR_MATH_OVERFLOW );
// type recognition?
- SbxDataType t(GetSuffixType(aLine[nCol]));
- if( t != SbxVARIANT )
+ if( nCol < aLine.getLength() )
{
- eScanType = t;
- ++pLine;
- ++nCol;
- }
+ SbxDataType t(GetSuffixType(aLine[nCol]));
+ if( t != SbxVARIANT )
+ {
+ eScanType = t;
+ ++pLine;
+ ++nCol;
+ }
+ }
}
// Hex/octal number? Read in and convert:
@@ -531,7 +534,7 @@ bool SbiScanner::NextSym()
PrevLineCommentLbl:
if( bPrevLineExtentsComment || (eScanType != SbxSTRING &&
- ( aSym[0] == '\'' || aSym.equalsIgnoreAsciiCase( "REM" ) ) ) )
+ ( aSym.startsWith("'") || aSym.equalsIgnoreAsciiCase( "REM" ) ) ) )
{
bPrevLineExtentsComment = false;
aSym = OUString("REM");