Use MIN macro from sys/param.h.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-05-02 01:49:42 +00:00
parent a8945bbf62
commit a175f065d9

View File

@ -3171,7 +3171,7 @@ makemask(struct sockaddr_storage *ssp, int bitlen)
return (-1);
for (i = 0; i < len; i++) {
bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
bits = MIN(CHAR_BIT, bitlen);
*p++ = (u_char)~0 << (CHAR_BIT - bits);
bitlen -= bits;
}