QXmlStreamReader: fix a qint64 -> int truncation

QIODevice::read() returns qint64, not int, and nbytesread is qint64,
too.

Pick-to: 5.15
Change-Id: I6d41c5c656336a95bb115b461282e9f247493c25
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Marc Mutz 2020-05-09 16:53:27 +02:00
parent a4eea312ed
commit 90ad722fb2

View File

@ -1490,8 +1490,8 @@ uint QXmlStreamReaderPrivate::getChar_helper()
nbytesread = 0;
if (device) {
rawReadBuffer.resize(BUFFER_SIZE);
int nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, BUFFER_SIZE - nbytesread);
nbytesread += qMax(nbytesreadOrMinus1, 0);
qint64 nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, BUFFER_SIZE - nbytesread);
nbytesread += qMax(nbytesreadOrMinus1, qint64{0});
} else {
if (nbytesread)
rawReadBuffer += dataBuffer;