mirror of https://github.com/omar-polo/gmid.git
use memset(3) rather than bzero(3)
There's no difference, but bzero(3) says STANDARDS The bzero() function conforms to the X/Open System Interfaces option of the IEEE Std 1003.1-2004 (“POSIX.1”) specification. It was removed from the standard in IEEE Std 1003.1-2008 (“POSIX.1”), which recommends using memset(3) instead. so here we are.
This commit is contained in:
parent
a91ad7f2ff
commit
df0c2926cc
4
gmid.c
4
gmid.c
|
@ -149,7 +149,7 @@ make_socket(int port, int family)
|
|||
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
bzero(&addr4, sizeof(addr4));
|
||||
memset(&addr4, 0, sizeof(addr4));
|
||||
addr4.sin_family = family;
|
||||
addr4.sin_port = htons(port);
|
||||
addr4.sin_addr.s_addr = INADDR_ANY;
|
||||
|
@ -158,7 +158,7 @@ make_socket(int port, int family)
|
|||
break;
|
||||
|
||||
case AF_INET6:
|
||||
bzero(&addr6, sizeof(addr6));
|
||||
memset(&addr6, 0, sizeof(addr6));
|
||||
addr6.sin6_family = AF_INET6;
|
||||
addr6.sin6_port = htons(port);
|
||||
addr6.sin6_addr = in6addr_any;
|
||||
|
|
Loading…
Reference in New Issue