Skip to content

Commit eab7174

Browse files
committed
prevent re-tagging of GzState
1 parent bb8bdfc commit eab7174

File tree

1 file changed

+5
-1
lines changed
  • libz-rs-sys-cdylib/src

1 file changed

+5
-1
lines changed

libz-rs-sys-cdylib/src/gz.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,7 @@ pub unsafe extern "C-unwind" fn gzseek64(
25882588

25892589
// Rewind, then skip to offset.
25902590
// Safety: `file` points to an initialized `GzState`.
2591-
if unsafe { gzrewind(file) } == -1 {
2591+
if unsafe { gzrewind_help(state) } == -1 {
25922592
return -1;
25932593
}
25942594
}
@@ -2665,6 +2665,10 @@ pub unsafe extern "C-unwind" fn gzrewind(file: gzFile) -> c_int {
26652665
return -1;
26662666
};
26672667

2668+
unsafe { gzrewind_help(state) }
2669+
}
2670+
2671+
unsafe fn gzrewind_help(state: &mut GzState) -> c_int {
26682672
// Check that we're reading and that there's no error.
26692673
if state.mode != GzMode::GZ_READ || (state.err != Z_OK && state.err != Z_BUF_ERROR) {
26702674
return -1;

0 commit comments

Comments
 (0)