Skip to content

Commit

Permalink
IconCache: Make valgrind happy (zero some struct padding bytes before…
Browse files Browse the repository at this point in the history
… writing to disk)
  • Loading branch information
hrydgard committed Oct 12, 2023
1 parent ae4f48c commit f1bc547
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Common/UI/IconCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void IconCache::SaveToFile(FILE *file) {

for (auto &iter : cache_) {
DiskCacheEntry entryHeader;
memset(&entryHeader, 0, sizeof(entryHeader)); // valgrind complains about padding bytes
entryHeader.keyLen = (uint32_t)iter.first.size();
entryHeader.dataLen = (uint32_t)iter.second.data.size();
entryHeader.format = iter.second.format;
Expand Down

0 comments on commit f1bc547

Please sign in to comment.