Skip to content

mtar_seek changes position even if seek callbak failed #26

@StellaSmith

Description

@StellaSmith

microtar/src/microtar.c

Lines 216 to 220 in 27076e1

int mtar_seek(mtar_t *tar, unsigned pos) {
int err = tar->seek(tar, pos);
tar->pos = pos;
return err;
}

The position is updated regardless if the seek operation fails.
As for fseek, the C standard specifies that if an error occurs, the file position is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions