1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #4781 from sunfishcode/sunfishcode/fix-warning

Fix a warning in upstream code on Rust nightly.
This commit is contained in:
Sylvestre Ledru 2023-04-25 07:57:02 +02:00 committed by GitHub
commit d3fc670f65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -321,7 +321,8 @@ macro_rules! f {
} else {
// SAFETY: We're holding PW_LOCK.
unsafe {
let data = $fnam(CString::new(k).unwrap().as_ptr());
let cstring = CString::new(k).unwrap();
let data = $fnam(cstring.as_ptr());
if !data.is_null() {
Ok($st::from_raw(ptr::read(data as *const _)))
} else {