remove direct call to addr in printing quad a for alpine support

This commit is contained in:
Murphy 2023-04-12 11:43:37 -04:00
parent a5c8188362
commit 435b32948b

View file

@ -79,10 +79,11 @@ void print_socket_addr(SocketAddr* addr, char* buffer) {
ntohs(addr->data.v4.sin_port) ntohs(addr->data.v4.sin_port)
); );
} else { } else {
uint8_t* a = (uint8_t*) &addr->data.v6.sin6_addr;
for(int i = 0; i < 8; i++) { for(int i = 0; i < 8; i++) {
APPEND(buffer, "%02hhx%02hhx:", APPEND(buffer, "%02hhx%02hhx:",
addr->data.v6.sin6_addr.__in6_u.__u6_addr8[i*2 + 0], a[i*2 + 0],
addr->data.v6.sin6_addr.__in6_u.__u6_addr8[i*2 + 1] a[i*2 + 1]
); );
} }
APPEND(buffer, ":[%hu]", ntohs(addr->data.v6.sin6_port)); APPEND(buffer, ":[%hu]", ntohs(addr->data.v6.sin6_port));