From 7ed8e17f2453327d86563c08620a9e33b7eaa401 Mon Sep 17 00:00:00 2001 From: bcook Date: Tue, 13 Jan 2015 02:23:33 +0000 Subject: [PATCH] prefer sizeof(thing) to sizeof(type) ok tedu@ deraadt@ --- usr.sbin/ntpd/ntp.c | 10 +++++----- 1 file 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 @@ -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; -- 2.20.1