Skip to content

Commit

Permalink
[delimitedtext] Don't use an out of range index while reading string …
Browse files Browse the repository at this point in the history
…buffer (fixes a Qt warning)
  • Loading branch information
nirvn committed Jul 28, 2020
1 parent a896ac9 commit ff38315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/delimitedtext/qgsdelimitedtextfile.cpp
Expand Up @@ -764,11 +764,8 @@ QgsDelimitedTextFile::Status QgsDelimitedTextFile::parseQuoted( QString &buffer,

while ( true )
{
QChar c = buffer[cp];
cp++;

// If end of line then if escaped or buffered then try to get more...
if ( cp > cpmax )
if ( cp >= cpmax )
{
if ( quoted || escaped )
{
Expand All @@ -787,6 +784,9 @@ QgsDelimitedTextFile::Status QgsDelimitedTextFile::parseQuoted( QString &buffer,
break;
}

QChar c = buffer[cp];
cp++;

// If escaped, then just append the character
if ( escaped )
{
Expand Down

0 comments on commit ff38315

Please sign in to comment.