From: Miroslav Lichvar Date: Thu, 22 Jan 2015 12:45:06 +0000 (+0100) Subject: ntp: keep all length constants signed X-Git-Tag: 2.0-pre1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9a31f36a02fa4e7ed8509825cf842ef8b1addd6;p=thirdparty%2Fchrony.git ntp: keep all length constants signed This should make it harder to accidentally create an unsafe comparison between signed and unsigned values. --- diff --git a/ntp.h b/ntp.h index 0e012be3..db5aabc6 100644 --- a/ntp.h +++ b/ntp.h @@ -94,7 +94,7 @@ typedef struct { uint8_t auth_data[NTP_MAX_MAC_LENGTH]; } NTP_Packet; -#define NTP_NORMAL_PACKET_LENGTH offsetof(NTP_Packet, auth_keyid) +#define NTP_NORMAL_PACKET_LENGTH (int)offsetof(NTP_Packet, auth_keyid) /* The buffer used to hold a datagram read from the network */ typedef struct {