From 071e522eec2d4f5f29ef929db4bf40af1860fdac Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 4 Jun 2022 17:01:06 +0200 Subject: tree-wide: convert inet_ntop() calls to anonymous-buffer macros --- src/libsystemd-network/sd-dhcp-lease.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libsystemd-network/sd-dhcp-lease.c') diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index 8de7c671df..acc57ce53a 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -967,7 +967,6 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { const struct in_addr *addresses; const void *client_id, *data; size_t client_id_len, data_len; - char sbuf[INET_ADDRSTRLEN]; const char *string; uint16_t mtu; _cleanup_free_ sd_dhcp_route **routes = NULL; @@ -989,11 +988,11 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { r = sd_dhcp_lease_get_address(lease, &address); if (r >= 0) - fprintf(f, "ADDRESS=%s\n", inet_ntop(AF_INET, &address, sbuf, sizeof(sbuf))); + fprintf(f, "ADDRESS=%s\n", IN4_ADDR_TO_STRING(&address)); r = sd_dhcp_lease_get_netmask(lease, &address); if (r >= 0) - fprintf(f, "NETMASK=%s\n", inet_ntop(AF_INET, &address, sbuf, sizeof(sbuf))); + fprintf(f, "NETMASK=%s\n", IN4_ADDR_TO_STRING(&address)); r = sd_dhcp_lease_get_router(lease, &addresses); if (r > 0) { @@ -1004,15 +1003,15 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { r = sd_dhcp_lease_get_server_identifier(lease, &address); if (r >= 0) - fprintf(f, "SERVER_ADDRESS=%s\n", inet_ntop(AF_INET, &address, sbuf, sizeof(sbuf))); + fprintf(f, "SERVER_ADDRESS=%s\n", IN4_ADDR_TO_STRING(&address)); r = sd_dhcp_lease_get_next_server(lease, &address); if (r >= 0) - fprintf(f, "NEXT_SERVER=%s\n", inet_ntop(AF_INET, &address, sbuf, sizeof(sbuf))); + fprintf(f, "NEXT_SERVER=%s\n", IN4_ADDR_TO_STRING(&address)); r = sd_dhcp_lease_get_broadcast(lease, &address); if (r >= 0) - fprintf(f, "BROADCAST=%s\n", inet_ntop(AF_INET, &address, sbuf, sizeof(sbuf))); + fprintf(f, "BROADCAST=%s\n", IN4_ADDR_TO_STRING(&address)); r = sd_dhcp_lease_get_mtu(lease, &mtu); if (r >= 0) -- cgit v1.2.3