diff --git a/src/ioslaves/file/file.cpp b/src/ioslaves/file/file.cpp --- a/src/ioslaves/file/file.cpp +++ b/src/ioslaves/file/file.cpp @@ -515,6 +515,11 @@ // qDebug() << "File::open -- read"; Q_ASSERT(mFile && mFile->isOpen()); + if (bytes == 0) { + // Nothing to do... + return data(QByteArray()); + } + while (true) { QByteArray res = mFile->read(bytes);