mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #4781 from sunfishcode/sunfishcode/fix-warning
Fix a warning in upstream code on Rust nightly.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user