-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
It seems that take_seek doesn't actually remap anything when calling seek. That means that calling seek can put the pointer outside of the defined buffer.
The following assert fails because the seek operation doesn't take into account the start and end constraints.
file.seek(128)?; // Place the pos at 128
let image: &mut TakeSeek<&mut File> = file.take_seek(128); // Make end 256
let offset = image.seek(SeekFrom::End(-64))?; // Should move the cursor to 192 internally, but it moves it to `EoF - 64`.
assert_eq!(offset, 64) <--- Should be `192 - pos`
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers