Skip to content

Commit

Permalink
Fix sign compare warning in file_compression.cpp
Browse files Browse the repository at this point in the history
Summary: Fairly easy, just use explicit type cast.

Reviewed By: jessek

Differential Revision: D14596603

fbshipit-source-id: 7cc430040c0c6cca12b4776ef64ba3a9daef1a19
  • Loading branch information
akindyakov authored and facebook-github-bot committed Mar 25, 2019
1 parent 08dc11b commit b93069b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osquery/filesystem/file_compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ Status archive(const std::set<boost::filesystem::path>& paths,
for (size_t i = 0; i < blkCount; i++) {
std::vector<char> block(block_size, 0);
auto r = pFile.read(block.data(), block_size);
if (r != block_size && r > 0) {
if (r > 0 && static_cast<std::size_t>(r) != block_size) {
// resize the buffer to size we read as last block is likely smaller
block.resize(r);
block.resize(static_cast<std::size_t>(r));
}
archive_write_data(arch, block.data(), block.size());
}
Expand Down

0 comments on commit b93069b

Please sign in to comment.