Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use explicit offsets for reading and writing #46

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Conversation

pothos
Copy link
Member

@pothos pothos commented Dec 22, 2023

  • download: Remove unused seek to 0

    The file is freshly opened and already at offset 0.

  • Use explicit offsets for reading and writing

    Currently the order in which the functions are called matters because
    they advance the offset. Some had seeks but not all.
    Use explicit read and write offsets to make the code more robust. Also,
    we have to make use of the start_block to calculate the destination even
    if we didn't ran into a problem yet because the way we generate the
    payload was giving the order we happened to write out.

How to use

Testing done

The generic payload and the sysext payload extracts as usual.

The file is freshly opened and already at offset 0.
Currently the order in which the functions are called matters because
they advance the offset. Some had seeks but not all.
Use explicit read and write offsets to make the code more robust. Also,
we have to make use of the start_block to calculate the destination even
if we didn't ran into a problem yet because the way we generate the
payload was giving the order we happened to write out.
@pothos pothos merged commit 3823606 into trunk Jan 3, 2024
1 check passed
@pothos pothos deleted the kai/pread-pwrite branch January 3, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants