50
50
On error, fills in za->error and returns 0.
54
_zip_file_get_offset(struct zip *za, int idx)
54
_zip_file_get_offset(const struct zip *za, zip_uint64_t idx, struct zip_error *error)
59
offset = za->cdir->entry[idx].offset;
61
if (fseeko(za->zp, offset, SEEK_SET) != 0) {
62
_zip_error_set(&za->error, ZIP_ER_SEEK, errno);
66
if (_zip_dirent_read(&de, za->zp, NULL, NULL, 1, &za->error) != 0)
69
offset += LENTRYSIZE + de.filename_len + de.extrafield_len;
71
_zip_dirent_finalize(&de);
59
offset = za->entry[idx].orig->offset;
61
if (fseeko(za->zp, (off_t)offset, SEEK_SET) != 0) {
62
_zip_error_set(error, ZIP_ER_SEEK, errno);
67
if ((size=_zip_dirent_size(za->zp, ZIP_EF_LOCAL, error)) < 0)
70
if (offset+(zip_uint32_t)size > ZIP_OFF_MAX) {
71
_zip_error_set(error, ZIP_ER_SEEK, EFBIG);
75
return offset + (zip_uint32_t)size;