Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Move the size_t cast inside the comparison so the result of CMSG_FIRS…
Browse files Browse the repository at this point in the history
…THDR is a pointer to the first header
  • Loading branch information
todayman committed Nov 21, 2014
1 parent 3f2ff00 commit 3485a30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/sys/posix/sys/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ version( linux )
private cmsghdr* __cmsg_nxthdr(msghdr*, cmsghdr*);
alias __cmsg_nxthdr CMSG_NXTHDR;

extern (D) size_t CMSG_FIRSTHDR( msghdr* mhdr )
extern (D) cmsghdr* CMSG_FIRSTHDR( msghdr* mhdr )
{
return cast(size_t)( mhdr.msg_controllen >= cmsghdr.sizeof
return ( cast(size_t)mhdr.msg_controllen >= cmsghdr.sizeof
? cast(cmsghdr*) mhdr.msg_control
: cast(cmsghdr*) null );
}
Expand Down

0 comments on commit 3485a30

Please sign in to comment.