Skip to content

Commit 2a2a023

Browse files
f nit
1 parent 1658377 commit 2a2a023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/util/chacha20poly1305rfc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<'a, W: Writer> Writer for ChaChaPolyWriter<'a, W> {
132132
// complete.
133133
fn write_all(&mut self, src: &[u8]) -> Result<(), io::Error> {
134134
let mut src_idx = 0;
135-
while src.len() - src_idx > 0 {
135+
while src_idx < src.len() {
136136
let mut write_buffer = [0; 8192];
137137
let bytes_written = (&mut write_buffer[..]).write(&src[src_idx..]).expect("In-memory writes can't fail");
138138
self.chacha.encrypt_in_place(&mut write_buffer[..bytes_written]);

0 commit comments

Comments
 (0)