diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 65c6bfdad1a..3b1208be7ac 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -697,10 +697,10 @@ bool QCryptographicHash::addData(QIODevice *device) return false; char buffer[1024]; - int length; + qint64 length; while ((length = device->read(buffer, sizeof(buffer))) > 0) - d->addData({buffer, length}); + d->addData({buffer, qsizetype(length)}); // length always <= 1024 return device->atEnd(); }