Skip to content

Commit 0ec027d

Browse files
Merge pull request #802 from jerry73204/fix-reading-buf-bug
2 parents 6d2a43e + d60e7cc commit 0ec027d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/fs/file.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl LockGuard<State> {
673673
if available > 0 || self.cache.is_empty() {
674674
// Copy data from the cache into the buffer.
675675
let n = cmp::min(available, buf.len());
676-
buf[..n].copy_from_slice(&self.cache[start..n]);
676+
buf[..n].copy_from_slice(&self.cache[start..(start + n)]);
677677

678678
// Move the read cursor forward.
679679
self.mode = Mode::Reading(start + n);

0 commit comments

Comments
 (0)