diff options
author | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-13 02:23:34 +0000 |
---|---|---|
committer | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-13 02:23:34 +0000 |
commit | ddbba4dd3bba88011784b2f5f1985a1d024ecbbc (patch) | |
tree | 0755ac608e4d5dfce0d14677b9fb24da0978b08f /usr.sbin | |
parent | a209fd905e20a4f97e9c61f05364bbab318301e6 (diff) |
prefer sizeof(thing) to sizeof(type)
ok tedu@ deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index e34d08c8c1b..4d635755583 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.125 2015/01/09 07:35:37 deraadt Exp $ */ +/* $OpenBSD: ntp.c,v 1.126 2015/01/13 02:23:33 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -200,7 +200,7 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf, while (ntp_quit == 0) { if (peer_cnt > idx2peer_elms) { if ((newp = reallocarray(idx2peer, peer_cnt, - sizeof(void *))) == NULL) { + sizeof(*idx2peer))) == NULL) { /* panic for now */ log_warn("could not resize idx2peer from %u -> " "%u entries", idx2peer_elms, peer_cnt); @@ -213,7 +213,7 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf, new_cnt = PFD_MAX + peer_cnt + listener_cnt + ctl_cnt; if (new_cnt > pfd_elms) { if ((newp = reallocarray(pfd, new_cnt, - sizeof(struct pollfd))) == NULL) { + sizeof(*pfd))) == NULL) { /* panic for now */ log_warn("could not resize pfd from %u -> " "%u entries", pfd_elms, new_cnt); @@ -223,8 +223,8 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf, pfd_elms = new_cnt; } - bzero(pfd, sizeof(struct pollfd) * pfd_elms); - bzero(idx2peer, sizeof(void *) * idx2peer_elms); + bzero(pfd, sizeof(*pfd) * pfd_elms); + bzero(idx2peer, sizeof(*idx2peer) * idx2peer_elms); nextaction = getmonotime() + 3600; pfd[PFD_PIPE_MAIN].fd = ibuf_main->fd; pfd[PFD_PIPE_MAIN].events = POLLIN; |