Skip to content

Commit

Permalink
cxx-qt-build: ensure bufreaders consume slices of equal length
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbooth committed Dec 21, 2024
1 parent 7fa5769 commit 5e6cbdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/cxx-qt-build/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ fn files_conflict(source: &Path, dest: &Path) -> Result<bool> {
return Ok(false);
}
let dest_bytes = dest.fill_buf()?;
if source_bytes != dest_bytes {
let bytes_len = bytes_len.min(dest_bytes.len());
if source_bytes[..bytes_len] != dest_bytes[..bytes_len] {
return Ok(true);
}
source.consume(bytes_len);
Expand Down

0 comments on commit 5e6cbdf

Please sign in to comment.