Skip to content

Commit

Permalink
inet: Static buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed May 25, 2020
1 parent 253fd2f commit 261d0b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib/util/inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ int fr_inet_pton_port(fr_ipaddr_t *out, uint16_t *port_out, char const *value,
* - NULL on error (use fr_syserror(errno)).
* - a pointer to out on success.
*/
char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr)
char *fr_inet_ntop(char out[static FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr)
{
char *p;
size_t len;
Expand Down Expand Up @@ -955,7 +955,7 @@ char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const
* - NULL on error (use fr_syserror(errno)).
* - a pointer to out on success.
*/
char *fr_inet_ntop_prefix(char out[FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr)
char *fr_inet_ntop_prefix(char out[static FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr)
{
char *p;
size_t len;
Expand Down Expand Up @@ -1106,7 +1106,7 @@ int fr_ipaddr_from_ifname(UNUSED fr_ipaddr_t *out, UNUSED int af, char const *na
* - NULL on error.
* - a pointer to out on success.
*/
char *fr_ifname_from_ifindex(char out[IFNAMSIZ], int if_index)
char *fr_ifname_from_ifindex(char out[static IFNAMSIZ], int if_index)
{
#ifdef HAVE_IF_INDEXTONAME
if (!if_indextoname(if_index, out)) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/util/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ int fr_inet_pton(fr_ipaddr_t *out, char const *value, ssize_t inlen, int af, boo
int fr_inet_pton_port(fr_ipaddr_t *out, uint16_t *port_out, char const *value,
ssize_t inlen, int af, bool resolve, bool mask);

char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr);
char *fr_inet_ntop(char out[static FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr);

char *fr_inet_ntop_prefix(char out[FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr);
char *fr_inet_ntop_prefix(char out[static FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr);

char *fr_inet_ifid_ntop(char *out, size_t outlen, uint8_t const *ifid);

Expand All @@ -130,7 +130,7 @@ uint8_t *fr_inet_ifid_pton(uint8_t out[static 8], char const *ifid_str);
int fr_ipaddr_from_ifname(fr_ipaddr_t *out, int af, char const *name);

#ifdef WITH_IFINDEX_NAME_RESOLUTION
char *fr_ifname_from_ifindex(char out[IFNAMSIZ], int if_index);
char *fr_ifname_from_ifindex(char out[static IFNAMSIZ], int if_index);
#endif

#ifdef WITH_IFINDEX_IPADDR_RESOLUTION
Expand Down

0 comments on commit 261d0b9

Please sign in to comment.