Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: bjorn3 <[email protected]>
  • Loading branch information
folkertdev and bjorn3 committed Nov 12, 2024
1 parent c18a11e commit 1ca34a1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bzip2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ unsafe fn uncompressStream(zStream: *mut FILE, stream: *mut FILE) -> bool {
unsafe fn testStream(zStream: *mut FILE) -> bool {
let mut bzf: *mut libc::c_void;
let mut bzerr: i32 = 0;
let ret: i32;
let mut i: i32;
let mut obuf: [u8; 5000] = [0; 5000];
let mut unused: [u8; 5000] = [0; 5000];
Expand Down Expand Up @@ -527,7 +526,7 @@ unsafe fn testStream(zStream: *mut FILE) -> bool {
break 'errhandler;
}

let mut unusedTmpV: *mut libc::c_void = std::ptr::null_mut::<libc::c_void>();
let mut unusedTmpV = std::ptr::null_mut();
BZ2_bzReadGetUnused(&mut bzerr, bzf, &mut unusedTmpV, &mut nUnused);
if bzerr != libbzip2_rs_sys::BZ_OK {
panic_str("test:bzReadGetUnused");
Expand All @@ -552,8 +551,7 @@ unsafe fn testStream(zStream: *mut FILE) -> bool {
if ferror(zStream) != 0 {
ioError() // diverges
}
ret = fclose(zStream);
if ret == libc::EOF {
if fclose(zStream) == libc::EOF {
ioError() // diverges
}

Expand Down

0 comments on commit 1ca34a1

Please sign in to comment.