Re: ntpd: prefer sizeof(thing) to sizeof(struct type)

2015-01-12 Thread Ted Unangst
On Mon, Jan 12, 2015 at 11:15, Brent Cook wrote: > > Would this more appropriately-scoped patch be OK? Looks reasonable to me.

Re: ntpd: prefer sizeof(thing) to sizeof(struct type)

2015-01-12 Thread Brent Cook
On Mon, Jan 12, 2015 at 05:44:20PM +0100, Reyk Floeter wrote: > On Mon, Jan 12, 2015 at 09:02:50AM -0600, Brent Cook wrote: > > On Fri, Jan 09, 2015 at 05:45:17PM -0500, Ted Unangst wrote: > > > On Fri, Jan 09, 2015 at 15:45, Brent Cook wrote: > > > > From: Brent Cook > > > > > > > > Yeah yeah, a

Re: ntpd: prefer sizeof(thing) to sizeof(struct type)

2015-01-12 Thread Reyk Floeter
On Mon, Jan 12, 2015 at 09:02:50AM -0600, Brent Cook wrote: > On Fri, Jan 09, 2015 at 05:45:17PM -0500, Ted Unangst wrote: > > On Fri, Jan 09, 2015 at 15:45, Brent Cook wrote: > > > From: Brent Cook > > > > > > Yeah yeah, a pointer is a pointer (except when it isn't :). I think this > > > looks n

Re: ntpd: prefer sizeof(thing) to sizeof(struct type)

2015-01-12 Thread Theo de Raadt
> - if ((p->query = calloc(1, sizeof(struct ntp_query))) == NULL) > + if ((p->query = calloc(1, sizeof(*(p->query == NULL) I do not think the replacement pattern is better in any way.

Re: ntpd: prefer sizeof(thing) to sizeof(struct type)

2015-01-12 Thread Brent Cook
On Fri, Jan 09, 2015 at 05:45:17PM -0500, Ted Unangst wrote: > On Fri, Jan 09, 2015 at 15:45, Brent Cook wrote: > > From: Brent Cook > > > > Yeah yeah, a pointer is a pointer (except when it isn't :). I think this > > looks nicer, since idx2peer is really the thing we're allocating to. > > what