Skip to content

Commit

Permalink
bzip2.rs: fprintf in outOfMemory and configError
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Nov 10, 2024
1 parent 7254412 commit 32225db
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions bzip2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,24 +1436,28 @@ unsafe fn mySIGSEGVorSIGBUScatcher(_: IntNative) {
}
_exit(exitValue);
}

unsafe fn outOfMemory() -> ! {
fprintf(
stderr,
b"\n%s: couldn't allocate enough memory\n\0" as *const u8 as *const libc::c_char,
progName,
eprintln!(
"\n{}: couldn't allocate enough memory",
CStr::from_ptr(progName).to_string_lossy(),
);
showFileNames();
cleanUpAndFail(1 as libc::c_int);
}

unsafe fn configError() -> ! {
fprintf(
stderr,
b"bzip2: I'm not configured correctly for this platform!\n\tI require Int32, Int16 and Char to have sizes\n\tof 4, 2 and 1 bytes to run properly, and they don't.\n\tProbably you can fix this by defining them correctly,\n\tand recompiling. Bye!\n\0"
as *const u8 as *const libc::c_char,
);
eprint!(concat!(
"bzip2: I'm not configured correctly for this platform!\n",
"\tI require Int32, Int16 and Char to have sizes\n",
"\tof 4, 2 and 1 bytes to run properly, and they don't.\n",
"\tProbably you can fix this by defining them correctly,\n",
"\tand recompiling. Bye!\n",
));
setExit(3 as libc::c_int);
exit(exitValue);
}

unsafe fn pad(s: *mut c_char) {
if strlen(s) as i32 >= longestFileName {
return;
Expand Down

0 comments on commit 32225db

Please sign in to comment.