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()