diff options
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r-- | src/corelib/io/qiodevice.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index a60aee1ebe..07634c3ca2 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -789,8 +789,10 @@ qint64 QIODevice::read(char *data, qint64 maxSize) readSoFar += lastReadChunkSize; // fast exit when satisfied by buffer if (lastReadChunkSize == maxSize && !(d->openMode & Text)) { - if (d->buffer.isEmpty()) + if (d->buffer.isEmpty()) { + d->buffer.clear(); readData(data, 0); + } return readSoFar; } |