]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Avoid a "conversion to '__uint16_t' from 'int' may alter its value"
authorRoy Marples <roy@marples.name>
Tue, 10 May 2016 07:37:30 +0000 (07:37 +0000)
committerRoy Marples <roy@marples.name>
Tue, 10 May 2016 07:37:30 +0000 (07:37 +0000)
error on some architectures (like m68k).

Thanks to Martin Husemann.

dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 474fb28639361fd6f0c4eae38a3f5dda7bb318bf..cb582f9f0fcbb24c83084d23cd7133ffd68dc903 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -887,7 +887,7 @@ make_message(struct bootp **bootpm, const struct interface *ifp, uint8_t type)
                        AREA_CHECK(2);
                        *p++ = DHO_MAXMESSAGESIZE;
                        *p++ = 2;
-                       sz = htons((uint16_t)mtu - IP_UDP_SIZE);
+                       sz = htons((uint16_t)(mtu - IP_UDP_SIZE));
                        memcpy(p, &sz, 2);
                        p += 2;
                }