mirror of
https://github.com/Noratrieb/uwuwind.git
synced 2026-01-15 09:05:07 +01:00
fmt
This commit is contained in:
parent
7a8a82b476
commit
591da9ff7d
8 changed files with 213 additions and 169 deletions
|
|
@ -50,7 +50,8 @@ pub(crate) fn with_last_os_error_str<R>(f: impl FnOnce(&str) -> R) -> R {
|
|||
|
||||
// SAFETY: Our buffer length is passed correctly
|
||||
let error = unsafe { libc::strerror_r(errno(), buf.as_mut_ptr().cast(), buf.len()) };
|
||||
// SAFETY: strerror_r writes the string to buf, even if it didnt write anything, we did zero init it.
|
||||
// SAFETY: strerror_r writes the string to buf, even if it didnt write anything,
|
||||
// we did zero init it.
|
||||
let cstr = if error != 0 {
|
||||
ffi::CStr::from_bytes_with_nul(b"<strerror_r returned an error>\n").unwrap()
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue