Files
mars-libowfat/socket/fmt_ip6if.c
2025-01-20 18:07:12 +00:00

15 lines
316 B
C

#include <libowfat/ip6.h>
#include <libowfat/fmt.h>
#include <libowfat/socket.h>
size_t fmt_ip6if(char* dest,const char ip[16],uint32 scope_id) {
size_t i=fmt_ip6(dest,ip);
if (scope_id) {
if (dest) {
dest[i]='%'; ++i; dest+=i;
}
i+=fmt_str(dest,socket_getifname(scope_id));
}
return i;
}