tree-wide: convert inet_ntop() calls to anonymous-buffer macros

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-06-06 09:52:52 +02:00
parent c71384a9ee
commit 071e522eec
6 changed files with 19 additions and 35 deletions
+2 -7
View File
@@ -192,7 +192,7 @@ static int call_get_addresses(
int family;
const void *a;
size_t sz;
char buf_ifi[DECIMAL_STR_MAX(int) + 2], buffer[MAX(INET6_ADDRSTRLEN, INET_ADDRSTRLEN)];
char buf_ifi[1 + DECIMAL_STR_MAX(int)] = "";
r = sd_bus_message_read(reply, "i", &family);
if (r < 0)
@@ -204,13 +204,8 @@ static int call_get_addresses(
if (family == AF_INET6 && ifi > 0)
xsprintf(buf_ifi, "%%%i", ifi);
else
strcpy(buf_ifi, "");
if (!strextend(&addresses,
prefix,
inet_ntop(family, a, buffer, sizeof(buffer)),
buf_ifi))
if (!strextend(&addresses, prefix, IN_ADDR_TO_STRING(family, a), buf_ifi))
return log_oom();
r = sd_bus_message_exit_container(reply);