diff options
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/lex.hxx | 4 | ||||
-rw-r--r-- | idl/source/cmptools/lex.cxx | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx index 238f5b904d20..2f816358bca8 100644 --- a/idl/inc/lex.hxx +++ b/idl/inc/lex.hxx @@ -140,7 +140,9 @@ class SvTokenStream int GetNextChar(); int GetFastNextChar() { - return aBufStr[nBufPos++]; + return (nBufPos < aBufStr.getLength()) + ? aBufStr[nBufPos++] + : '\0'; } void FillTokenList(); diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index d6644b8e1297..3e131ee7bf43 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -151,9 +151,9 @@ void SvTokenStream::FillTokenList() int SvTokenStream::GetNextChar() { int nChar; - if( aBufStr.getLength() < nBufPos ) + while (aBufStr.getLength() <= nBufPos) { - if( rInStream.ReadLine( aBufStr ) ) + if (rInStream.ReadLine(aBufStr)) { nLine++; nColumn = 0; |