current_dll_path: fix mistake in assertion message

This commit is contained in:
Ralf Jung
2025-05-19 20:20:34 +02:00
parent e5a2a6a15d
commit c99c4b17b2

View File

@@ -82,7 +82,7 @@ fn current_dll_path() -> Result<PathBuf, String> {
let fname_ptr = info.dli_fname.as_ptr();
#[cfg(not(target_os = "cygwin"))]
let fname_ptr = {
assert!(!info.dli_fname.is_null(), "the docs do not allow dladdr to be null");
assert!(!info.dli_fname.is_null(), "dli_fname cannot be null");
info.dli_fname
};
let bytes = CStr::from_ptr(fname_ptr).to_bytes();