libc.c: fix ptr when partially reading sector

This commit is contained in:
Xavier Del Campo Romero 2021-12-08 03:24:01 +01:00
parent ca52bfc045
commit d78c64ba7c
1 changed files with 1 additions and 0 deletions

View File

@ -286,6 +286,7 @@ static size_t cdromread(void *restrict ptr, size_t sz,
const size_t firstsz = SECTOR_SZ - first_sector_sz;
memcpy(ptr, &f->buf[first_sector_sz], firstsz);
ptr = (char *)ptr + firstsz;
f->pos += firstsz;
lseek(f->fildes, f->pos, SEEK_SET);
f->cache_available = 0;