diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index 5e4fe447..625d16e7 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,4 +1,4 @@ -use std::mem; +use std::{mem, ptr}; use windows_sys::Win32::{ Foundation::{FreeLibrary, HMODULE, S_OK}, System::{ @@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE); impl LibraryHandle { fn new(name: &[u8]) -> Option { let handle = unsafe { LoadLibraryA(name.as_ptr() as _) }; - (handle != 0).then(|| Self(handle)) + (handle != ptr::null_mut()).then(|| Self(handle)) } /// Get a function pointer to a function in the library.