Skip to content

Commit

Permalink
Fix regression caused by a3d8633 (writing OSD)
Browse files Browse the repository at this point in the history
  • Loading branch information
ousnius committed Jan 26, 2022
1 parent 7db256a commit fb27bfc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/DiffData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,15 @@ bool OSDataFile::Write(const std::string& fileName) {
std::vector<DiffStruct> diffData(diffSize);
diffData.resize(diffSize);

size_t i = 0;

for (auto& diff : diffs.second) {
if (diff.first < diffSize) {
diffData[diff.first].index = diff.first;
diffData[diff.first].diff = diff.second;
}
if (i >= diffSize)
break;

diffData[i].index = diff.first;
diffData[i].diff = diff.second;
++i;
}

file.write((char*)&diffSize, 2);
Expand Down

0 comments on commit fb27bfc

Please sign in to comment.