mirror of
https://github.com/wez/wezterm.git
synced 2024-08-17 02:00:25 +03:00
Fix uninit UB in filedescriptor unix.rs
This commit is contained in:
parent
8437d787b8
commit
ca0e358262
@ -461,9 +461,11 @@ mod macos {
|
||||
impl FdSet {
|
||||
pub fn new() -> Self {
|
||||
unsafe {
|
||||
let mut set = std::mem::MaybeUninit::uninit().assume_init();
|
||||
FD_ZERO(&mut set);
|
||||
Self { set }
|
||||
let mut set = std::mem::MaybeUninit::uninit();
|
||||
FD_ZERO(set.as_mut_ptr());
|
||||
Self {
|
||||
set: set.assume_init(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user