From bcc07c935e60048eab4983c0b1a1ebb8a6734366 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 12 Mar 2020 19:20:42 +0100 Subject: [PATCH] tests: improved ipv6-prefix Signed-off-by: Nikos Mavrogiannopoulos --- tests/ipv6-prefix.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/ipv6-prefix.c b/tests/ipv6-prefix.c index e7c99c6c..5cc77cf2 100644 --- a/tests/ipv6-prefix.c +++ b/tests/ipv6-prefix.c @@ -23,18 +23,17 @@ #include "../src/ip-util.h" #include "../src/ip-util.c" -static char* my_ipv6_prefix_to_mask(const char *str, unsigned prefix) +static char* my_ipv6_prefix_to_mask(char str[MAX_IP_STR], unsigned prefix) { struct in6_addr in; - static char out[64]; if (ipv6_prefix_to_mask(&in, prefix) == 0) return NULL; - if (inet_ntop(AF_INET6, &in, out, sizeof(out)) == NULL) + if (inet_ntop(AF_INET6, &in, str, MAX_IP_STR) == NULL) return NULL; - return out; + return str; } int main()