Skip to content

Commit

Permalink
create a null pointer with std::ptr::null_mut()
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Jan 6, 2025
1 parent 4a20fc6 commit f9dafba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion teletypewriter/src/windows/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl ChildExitWatcher {
pub fn new(child_handle: HANDLE) -> Result<ChildExitWatcher, Error> {
let (event_tx, event_rx) = channel::<ChildEvent>();

let mut wait_handle: HANDLE = 0;
let mut wait_handle: HANDLE = std::ptr::null_mut();
let sender_ref = Box::new(event_tx);

let success = unsafe {
Expand Down
2 changes: 1 addition & 1 deletion teletypewriter/src/windows/conpty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ConptyApi {
type LoadedFn = unsafe extern "system" fn() -> isize;
unsafe {
let hmodule = LoadLibraryW(w!("conpty.dll"));
if hmodule == 0 {
if hmodule == std::ptr::null_mut() {
return None;
}
let create_fn = GetProcAddress(hmodule, s!("CreatePseudoConsole"))?;
Expand Down
2 changes: 1 addition & 1 deletion teletypewriter/src/windows/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl Drop for EventedAnonRead {

// Stop reader thread waiting for pipe contents
unsafe {
CancelSynchronousIo(thread.as_raw_handle() as isize);
CancelSynchronousIo(thread.as_raw_handle());
}

thread
Expand Down

0 comments on commit f9dafba

Please sign in to comment.