diff options
-rw-r--r-- | basic/source/comp/scanner.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 6dfe2c589bbf..784122d6d7c1 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -543,7 +543,7 @@ bool SbiScanner::NextSym() case '>': if( *pLine == '=' ) n = 2; break; case ':': if( *pLine == '=' ) n = 2; break; } - aSym = aLine.copy( nCol, n ); + aSym = aLine.copy(nCol, std::min(n, aLine.getLength() - nCol)); pLine += n-1; nCol = nCol + n; } |