fix safe read reading zero bytes

pull/3/head
Szymon Walter 2018-03-20 14:34:06 +01:00
parent 2a755f740d
commit d24fde3c3d
1 changed files with 3 additions and 0 deletions

View File

@ -349,6 +349,9 @@ mod file {
let mut vec = Vec::with_capacity(
(range.end - range.start).index64() as usize,
);
unsafe {
vec.set_len((range.end - range.start).index64() as usize);
}
let mut refmut = self.borrow_mut();
refmut
.seek(SeekFrom::Start(index.index64()))