QXmlStreamReader: fix integer truncation (qint64 → int)

We don't care about the actual type of oldLineNumber here, we just
need it to be of the same type as lineNumber, to avoid truncation, so
we use auto.

This was already broken in 5.15 (lineNumber was already a qint64).

Pick-to: 6.3 6.2 5.15
Change-Id: I68d7e6e91c8122bf426c9c10e8cc91ff55c61a20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2022-05-06 01:08:19 +02:00
parent 2438551152
commit 389fdd6d8d
1 changed files with 1 additions and 1 deletions

View File

@ -958,7 +958,7 @@ inline uint QXmlStreamReaderPrivate::peekChar()
bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)
{
int pos = textBuffer.size();
int oldLineNumber = lineNumber;
const auto oldLineNumber = lineNumber;
uint c;
while ((c = getChar()) != StreamEOF) {