]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: keep all length constants signed
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Jan 2015 12:45:06 +0000 (13:45 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 22 Jan 2015 13:37:35 +0000 (14:37 +0100)
This should make it harder to accidentally create an unsafe comparison
between signed and unsigned values.

ntp.h

diff --git a/ntp.h b/ntp.h
index 0e012be3f80b95c430c44740fb8df27fc662c5cc..db5aabc6178737d5b66aa7f4f89356144eaee762 100644 (file)
--- 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 {