aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-09-24 08:08:49 +0000
committerOmar Polo <op@omarpolo.com>2021-09-24 08:08:49 +0000
commitdf0c2926ccb753d07a3f20f3626a20f7079453ee (patch)
tree3dc027b6c94d2d9a3c310bce4ce25f791bcc1260 /gmid.c
parenta91ad7f2ffac3f1cec0c6c42e780ab5efc92ba5c (diff)
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.
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gmid.c b/gmid.c
index ad33957..b4b238c 100644
--- a/gmid.c
+++ b/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;