diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index abe263c6bd..2d4054f7c2 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -183,13 +183,13 @@ nm_utils_inet_ntop (int addr_family, gconstpointer addr, char *dst) } static inline const char * -_nm_utils_inet4_ntop (in_addr_t addr, char *dst) +_nm_utils_inet4_ntop (in_addr_t addr, char dst[static INET_ADDRSTRLEN]) { return nm_utils_inet_ntop (AF_INET, &addr, dst); } static inline const char * -_nm_utils_inet6_ntop (const struct in6_addr *addr, char *dst) +_nm_utils_inet6_ntop (const struct in6_addr *addr, char dst[static INET6_ADDRSTRLEN]) { return nm_utils_inet_ntop (AF_INET6, addr, dst); } diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 03dbbcf81f..cbbac2816b 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2999,7 +2999,8 @@ nm_utils_ipv6_interface_identifier_get_from_token (NMUtilsIPv6IfaceId *iid, * Returns: the input buffer filled with the id as string. */ const char * -nm_utils_inet6_interface_identifier_to_token (NMUtilsIPv6IfaceId iid, char *buf) +nm_utils_inet6_interface_identifier_to_token (NMUtilsIPv6IfaceId iid, + char buf[static INET6_ADDRSTRLEN]) { struct in6_addr i6_token = { .s6_addr = { 0, } }; diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h index 7d63d06afc..fbb7987573 100644 --- a/src/nm-core-utils.h +++ b/src/nm-core-utils.h @@ -316,7 +316,7 @@ gboolean nm_utils_ipv6_interface_identifier_get_from_token (NMUtilsIPv6IfaceId * const char *token); const char *nm_utils_inet6_interface_identifier_to_token (NMUtilsIPv6IfaceId iid, - char *buf); + char buf[static INET6_ADDRSTRLEN]); gboolean nm_utils_get_ipv6_interface_identifier (NMLinkType link_type, const guint8 *hwaddr,