Don't cast pointers to int in definitions of PRISM2_HOSTAPD_RID_HDR_LEN and PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN. Use size_t instead. That's actually what the code needs.