Use type cast to get rid of implicit sign extension

The size_t value here can be 64-bit and result in implicit sign
extension. In this particular case, that gets masked out by
host_to_be32(), so there is no practical difference, but it is better
to get rid of the 64-bit variable explicitly.
This commit is contained in:
Jouni Malinen 2011-04-14 01:27:38 +03:00 committed by Jouni Malinen
parent f8b5f7dc6b
commit 74727a7b32

View file

@ -202,7 +202,7 @@ static u8 * eap_ttls_avp_hdr(u8 *avphdr, u32 avp_code, u32 vendor_id,
} }
avp->avp_code = host_to_be32(avp_code); avp->avp_code = host_to_be32(avp_code);
avp->avp_length = host_to_be32((flags << 24) | (hdrlen + len)); avp->avp_length = host_to_be32((flags << 24) | (u32) (hdrlen + len));
return avphdr + hdrlen; return avphdr + hdrlen;
} }