+* Document a tricky malloc() of dns_ctx in sntp.
(4.2.7p313) 2012/10/23 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2291] sntp should report why it cannot open file.kod.
* [Bug 2293] add support for SO_BINTIME, refine support for
hints.ai_protocol = IPPROTO_UDP;
name_sz = 1 + strlen(name);
- octets = sizeof(*ctx) + name_sz;
- ctx = emalloc_zero(octets);
- name_copy = (char *)(ctx + 1);
- memcpy(name_copy, name, name_sz);
- ctx->name = name_copy;
+ octets = sizeof(*ctx) + name_sz; // Space for a ctx and the name
+ ctx = emalloc_zero(octets); // ctx at ctx[0]
+ name_copy = (char *)(ctx + 1); // Put the name at ctx[1]
+ memcpy(name_copy, name, name_sz); // copy the name to ctx[1]
+ ctx->name = name_copy; // point to it...
ctx->flags = flags;
ctx->timeout = response_tv;