diff --git a/src/netbsd.rs b/src/netbsd.rs index 34c77837..607f2b97 100644 --- a/src/netbsd.rs +++ b/src/netbsd.rs @@ -31,7 +31,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { // getrandom(2) was introduced in NetBSD 10.0 static GETRANDOM: Weak = unsafe { Weak::new("getrandom\0") }; if let Some(fptr) = GETRANDOM.ptr() { - let func: GetRandomFn = unsafe { core::mem::transmute(fptr) }; + let func = fptr.cast::().as_ptr(); return sys_fill_exact(dest, |buf| unsafe { func(buf.as_mut_ptr().cast::(), buf.len(), 0) });