sa/printaddr: fix win32 scope id
ref:
@@ -31,15 +31,19 @@ int sa_print_addr(struct re_printf *pf, const struct sa *sa)
err = re_hprintf(pf, "%j", sa);
-#if defined (HAVE_GETIFADDRS) && defined (HAVE_INET6)
+#ifdef HAVE_INET6
if (sa_af(sa) == AF_INET6 && sa_is_linklocal(sa)) {
-
+#ifdef HAVE_GETIFADDRS
char ifname[IF_NAMESIZE];
if (!if_indextoname(sa->u.in6.sin6_scope_id, ifname))
return errno;
err |= re_hprintf(pf, "%%%s", ifname);
+#else
+ uint32_t scope_id = sa_scopeid(sa);
+ err |= re_hprintf(pf, "%%%d", scope_id);
+#endif
}
#endif
