diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-09 16:53:27 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-19 13:57:26 +0200 |
commit | 146846c48a2b0764ba89476d540b24b15c2df914 (patch) | |
tree | c102e6c38a36c50078e80543895790a9460c22be /src/corelib/serialization/qxmlstream.cpp | |
parent | a5b2bfe2b34c5e40b8cefef37b130b9a9afa43c8 (diff) |
QXmlStreamReader: fix a qint64 -> int truncation
QIODevice::read() returns qint64, not int, and nbytesread is qint64,
too.
Change-Id: I6d41c5c656336a95bb115b461282e9f247493c25
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 90ad722fb294b9c8bc7bb83d507b9b47d4d09367)
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qxmlstream.cpp')
-rw-r--r-- | src/corelib/serialization/qxmlstream.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 3e42a58bbe..8aa8dd8f0d 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -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; |