Skip to content

Commit

Permalink
Fix typo in CMSG_NXTHDR for OSX from PR rust-lang#1212
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Jan 31, 2019
1 parent 42cd3ba commit fc90925
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2396,11 +2396,10 @@ f! {
return ::CMSG_FIRSTHDR(mhdr);
};
let cmsg_len = (*cmsg).cmsg_len as usize;
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize)
+ __DARWIN_ALIGN32(mem::size_of::<::cmsghdr>());
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next > max {
if next + __DARWIN_ALIGN32(mem::size_of::<::cmsghdr>()) > max {
0 as *mut ::cmsghdr
} else {
next as *mut ::cmsghdr
Expand Down

0 comments on commit fc90925

Please sign in to comment.