From: Roy Marples Date: Tue, 10 May 2016 07:37:30 +0000 (+0000) Subject: Avoid a "conversion to '__uint16_t' from 'int' may alter its value" X-Git-Tag: v6.11.1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=945c2f21f9ae5e57e13f4349fbb57d3e8abb8045;p=thirdparty%2Fdhcpcd.git Avoid a "conversion to '__uint16_t' from 'int' may alter its value" error on some architectures (like m68k). Thanks to Martin Husemann. --- diff --git a/dhcp.c b/dhcp.c index 474fb286..cb582f9f 100644 --- 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; }