rxi/microtar

mtar_seek changes position even if seek callbak failed

StellaSmith opened this issue · 0 comments

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.