diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 19:02:50 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 19:02:50 +0000 |
commit | 39e3814da357256d2f3e7a0d817908d71582604a (patch) | |
tree | 12ab986f9908abe6d7622bed3f40c6272f2292e6 /usr.sbin/ldpctl | |
parent | dc0b9e3dfc38c0ae0e5b1d9a7f6cad553922ed78 (diff) |
Replace legacy bzero and bcopy by memset and memcpy.
bzero(), bcopy() and bcmp() were deprecated in POSIX.1-2001 and removed
in POSIX.1-2008 in deference to memset(), memcpy() and memcmp().
Diffstat (limited to 'usr.sbin/ldpctl')
-rw-r--r-- | usr.sbin/ldpctl/ldpctl.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpctl/parser.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c index 2882d77a832..22781f22f74 100644 --- a/usr.sbin/ldpctl/ldpctl.c +++ b/usr.sbin/ldpctl/ldpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpctl.c,v 1.27 2016/05/23 19:01:08 renato Exp $ +/* $OpenBSD: ldpctl.c,v 1.28 2016/05/23 19:02:49 renato Exp $ * * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -88,7 +88,7 @@ main(int argc, char *argv[]) if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "socket"); - bzero(&sun, sizeof(sun)); + memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_UNIX; strlcpy(sun.sun_path, LDPD_SOCKET, sizeof(sun.sun_path)); if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) diff --git a/usr.sbin/ldpctl/parser.c b/usr.sbin/ldpctl/parser.c index e4ca6846be2..d8c073e312d 100644 --- a/usr.sbin/ldpctl/parser.c +++ b/usr.sbin/ldpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.9 2016/05/23 19:01:08 renato Exp $ */ +/* $OpenBSD: parser.c,v 1.10 2016/05/23 19:02:49 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -139,7 +139,7 @@ parse(int argc, char *argv[]) const struct token *table = t_main; const struct token *match; - bzero(&res, sizeof(res)); + memset(&res, 0, sizeof(res)); while (argc >= 0) { if ((match = match_token(argv[0], table, &res)) == NULL) { @@ -282,8 +282,8 @@ parse_addr(const char *word, struct in_addr *addr) if (word == NULL) return (0); - bzero(addr, sizeof(struct in_addr)); - bzero(&ina, sizeof(ina)); + memset(addr, 0, sizeof(struct in_addr)); + memset(&ina, 0, sizeof(ina)); if (inet_pton(AF_INET, word, &ina)) { addr->s_addr = ina.s_addr; @@ -302,8 +302,8 @@ parse_prefix(const char *word, struct in_addr *addr, uint8_t *prefixlen) if (word == NULL) return (0); - bzero(addr, sizeof(struct in_addr)); - bzero(&ina, sizeof(ina)); + memset(addr, 0, sizeof(struct in_addr)); + memset(&ina, 0, sizeof(ina)); if (strrchr(word, '/') != NULL) { if ((bits = inet_net_pton(AF_INET, word, |