Skip to content

Commit b93069b

Browse files
akindyakovfacebook-github-bot
authored andcommitted
Fix sign compare warning in file_compression.cpp
Summary: Fairly easy, just use explicit type cast. Reviewed By: jessek Differential Revision: D14596603 fbshipit-source-id: 7cc430040c0c6cca12b4776ef64ba3a9daef1a19
1 parent 08dc11b commit b93069b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

osquery/filesystem/file_compression.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ Status archive(const std::set<boost::filesystem::path>& paths,
187187
for (size_t i = 0; i < blkCount; i++) {
188188
std::vector<char> block(block_size, 0);
189189
auto r = pFile.read(block.data(), block_size);
190-
if (r != block_size && r > 0) {
190+
if (r > 0 && static_cast<std::size_t>(r) != block_size) {
191191
// resize the buffer to size we read as last block is likely smaller
192-
block.resize(r);
192+
block.resize(static_cast<std::size_t>(r));
193193
}
194194
archive_write_data(arch, block.data(), block.size());
195195
}

0 commit comments

Comments
 (0)