From f9a31f36a02fa4e7ed8509825cf842ef8b1addd6 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Thu, 22 Jan 2015 13:45:06 +0100 Subject: [PATCH] ntp: keep all length constants signed This should make it harder to accidentally create an unsafe comparison between signed and unsigned values. --- ntp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntp.h b/ntp.h index 0e012be..db5aabc 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 {