diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index c945842d0b4..05a2d23f1da 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -696,10 +696,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(); }