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:
parent
2ccf6c60d9
commit
f1e87dc9bc
@ -106,15 +106,15 @@ static QByteArray localHostName()
|
||||
*/
|
||||
static QComposeCacheFileHeader readFileMetadata(const QString &path)
|
||||
{
|
||||
QComposeCacheFileHeader info;
|
||||
info.reserved = 0;
|
||||
info.fileSize = 0;
|
||||
quint64 fileSize = 0;
|
||||
qint64 lastModified = 0;
|
||||
const QByteArray pathBytes = QFile::encodeName(path);
|
||||
QT_STATBUF st;
|
||||
if (QT_STAT(pathBytes.data(), &st) != 0)
|
||||
return info;
|
||||
info.lastModified = st.st_mtime;
|
||||
info.fileSize = st.st_size;
|
||||
if (QT_STAT(pathBytes.data(), &st) == 0) {
|
||||
lastModified = st.st_mtime;
|
||||
fileSize = st.st_size;
|
||||
}
|
||||
QComposeCacheFileHeader info = { 0, 0, fileSize, lastModified };
|
||||
return info;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user