Skip to content

Commit

Permalink
Replace '0 as *_' with ptr::null*()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Mairs committed Dec 20, 2017
1 parent 7c1fe90 commit 48aa9c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ pub fn sendmsg<'a>(fd: RawFd, iov: &[IoVec<&'a [u8]>], cmsgs: &[ControlMessage<'

let (name, namelen) = match addr {
Some(addr) => { let (x, y) = unsafe { addr.as_ffi_pair() }; (x as *const _, y) }
None => (0 as *const _, 0),
None => (ptr::null(), 0),
};

let cmsg_ptr = if capacity > 0 {
Expand Down Expand Up @@ -644,7 +644,7 @@ pub fn recvmsg<'a, T>(fd: RawFd, iov: &[IoVec<&mut [u8]>], cmsg_buffer: Option<&
let mut address: sockaddr_storage = unsafe { mem::uninitialized() };
let (msg_control, msg_controllen) = match cmsg_buffer {
Some(cmsg_buffer) => (cmsg_buffer as *mut _, mem::size_of_val(cmsg_buffer)),
None => (0 as *mut _, 0),
None => (ptr::null_mut(), 0),
};
let mut mhdr = unsafe {
let mut mhdr: msghdr = mem::uninitialized();
Expand Down

0 comments on commit 48aa9c8

Please sign in to comment.