QTableGenerator: Fix uninit'ed values

It's probably benign, but it causes Corverity to complain,
so always init all fields of QComposeCacheFileHeader.

Format the code so it can easily be ported to uniform init
later on.

Coverity-Id: 93043
Change-Id: Ifa1ccc3fa58dc813306917f216772fd24d4930c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2016-09-15 15:25:01 +02:00 committed by Thiago Macieira
parent 2ccf6c60d9
commit f1e87dc9bc

View File

@ -106,15 +106,15 @@ static QByteArray localHostName()
*/ */
static QComposeCacheFileHeader readFileMetadata(const QString &path) static QComposeCacheFileHeader readFileMetadata(const QString &path)
{ {
QComposeCacheFileHeader info; quint64 fileSize = 0;
info.reserved = 0; qint64 lastModified = 0;
info.fileSize = 0;
const QByteArray pathBytes = QFile::encodeName(path); const QByteArray pathBytes = QFile::encodeName(path);
QT_STATBUF st; QT_STATBUF st;
if (QT_STAT(pathBytes.data(), &st) != 0) if (QT_STAT(pathBytes.data(), &st) == 0) {
return info; lastModified = st.st_mtime;
info.lastModified = st.st_mtime; fileSize = st.st_size;
info.fileSize = st.st_size; }
QComposeCacheFileHeader info = { 0, 0, fileSize, lastModified };
return info; return info;
} }