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)

(cherry picked from commit ff38315)
  • Loading branch information
nirvn authored and nyalldawson committed Aug 15, 2020
1 parent 6d17c1b commit 62a339e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/delimitedtext/qgsdelimitedtextfile.cpp
Expand Up @@ -761,11 +761,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 @@ -784,6 +781,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 62a339e

Please sign in to comment.