Skip to content

Commit f54e564

Browse files
committed
test: remove unused assignment
1 parent 9f598d2 commit f54e564

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libc-test/tests/cmsg.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ mod t {
3030

3131
#[test]
3232
fn test_cmsg_firsthdr() {
33+
let mut buf = [0u8; 256];
3334
let mut mhdr: msghdr = unsafe { mem::zeroed() };
34-
mhdr.msg_control = 0xdeadbeef as *mut c_void;
35-
let pmhdr = &mhdr as *const msghdr;
35+
mhdr.msg_control = buf.as_mut_ptr().cast::<c_void>();
36+
3637
for l in 0..128 {
37-
mhdr.msg_controllen = l;
38+
mhdr.msg_controllen = l as _;
3839
unsafe {
39-
assert_eq!(libc::CMSG_FIRSTHDR(pmhdr), cmsg_firsthdr(pmhdr));
40+
assert_eq!(libc::CMSG_FIRSTHDR(&mhdr), cmsg_firsthdr(&mhdr));
4041
}
4142
}
4243
}

0 commit comments

Comments
 (0)