mirror of
https://github.com/fluencelabs/musl
synced 2025-06-28 22:22:01 +00:00
fix argument types for legacy function inet_makeaddr
the type int was taken from seemingly erroneous man pages. glibc uses in_addr_t (uint32_t), and semantically, the arguments should be unsigned.
This commit is contained in:
@ -16,9 +16,8 @@ int inet_aton(const char *cp, struct in_addr *inp)
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct in_addr inet_makeaddr(int net, int host)
|
||||
struct in_addr inet_makeaddr(in_addr_t n, in_addr_t h)
|
||||
{
|
||||
uint32_t n = net, h = host;
|
||||
if (n < 256) h |= n<<24;
|
||||
else if (n < 65536) h |= n<<16;
|
||||
else h |= n<<8;
|
||||
|
Reference in New Issue
Block a user