From 8f2d776bd0490156170c15c368c51416dd08c3d4 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 28 May 2025 17:12:57 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 3: Unsigned difference expression compared to zero Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/update_engine/extent_writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/update_engine/extent_writer.cc b/src/update_engine/extent_writer.cc index c28956b..1062574 100644 --- a/src/update_engine/extent_writer.cc +++ b/src/update_engine/extent_writer.cc @@ -18,7 +18,7 @@ bool DirectExtentWriter::Write(const void* bytes, size_t count) { return true; const char* c_bytes = reinterpret_cast(bytes); size_t bytes_written = 0; - while (count - bytes_written > 0) { + while (bytes_written < count) { TEST_AND_RETURN_FALSE(next_extent_index_ < extents_.size()); uint64_t bytes_remaining_next_extent = extents_[next_extent_index_].num_blocks() * block_size_ -