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 (port_r) *port_r= ntohs(port);
return 0;
}
+
+char *adns__sockaddr_ntoa(const struct sockaddr *sa, char *buf) {
+ int err;
+ int len= ADNS_ADDR2TEXT_BUFLEN;
+
+ err= adns_addr2text(sa, 0, buf, &len, 0);
+ if (err == EIO)
+ err= adns_addr2text(sa, adns_qf_addrlit_scope_numeric, buf, &len, 0);
+ assert(!err);
+ return buf;
+}