summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b320939)
At the point we print `adns_addr2text: will print scoped addr ...' the
buffer isn't null-terminated. Fortunately, we have the length of the
valid portion of the buffer, so use that to print only the good piece.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
assert(remain >= IF_NAMESIZE+1/*%*/);
*scopeptr++= '%'; remain--;
bool parsedname = 0;
assert(remain >= IF_NAMESIZE+1/*%*/);
*scopeptr++= '%'; remain--;
bool parsedname = 0;
- af_debug("will print scoped addr %s %% %"PRIu32"", buffer, scope);
+ af_debug("will print scoped addr `%.*s' %% %"PRIu32"",
+ scopeoffset,buffer, scope);
if (scope <= UINT_MAX /* so we can pass it to if_indextoname */
&& !(flags & adns_qf_addrlit_scope_numeric)
&& addrtext_scope_use_ifname(sa)) {
if (scope <= UINT_MAX /* so we can pass it to if_indextoname */
&& !(flags & adns_qf_addrlit_scope_numeric)
&& addrtext_scope_use_ifname(sa)) {