summaryrefslogtreecommitdiffstats
path: root/buffered-reader
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-01-21 23:35:17 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-01-21 23:35:17 +0100
commitacbcd3360bdc0091769d2367c7bd97363b8aa087 (patch)
tree6f26b83e986cd30450d1d7b00d8b22145029d5f7 /buffered-reader
parentabd25fcc62c0a5f2390f118c5ef12f427b0f5af9 (diff)
buffered-reader: Fix panic.
Diffstat (limited to 'buffered-reader')
-rw-r--r--buffered-reader/src/dup.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffered-reader/src/dup.rs b/buffered-reader/src/dup.rs
index d7d3f7e5..cba6bf23 100644
--- a/buffered-reader/src/dup.rs
+++ b/buffered-reader/src/dup.rs
@@ -73,7 +73,7 @@ impl<T: BufferedReader<C>, C: fmt::Debug + Sync + Send> io::Read for Dup<T, C> {
let data = &data[self.cursor..];
let amount = cmp::min(buf.len(), data.len());
- buf.copy_from_slice(&data[..amount]);
+ buf[..amount].copy_from_slice(&data[..amount]);
self.cursor += amount;