From 5f3c27e3a6512e6548d6b4ae29f4568ba7f0668d Mon Sep 17 00:00:00 2001 From: Logan oos Even <46396513+Logan007@users.noreply.github.com> Date: Thu, 7 Oct 2021 14:05:29 +0545 Subject: [PATCH] compile fix (#846) --- tools/tests-wire.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/tests-wire.c b/tools/tests-wire.c index 5dfa5de..184092f 100644 --- a/tools/tests-wire.c +++ b/tools/tests-wire.c @@ -69,7 +69,8 @@ void init_common(n2n_common_t *common, char *community) { memset( common, 0, sizeof(*common) ); common->ttl = N2N_DEFAULT_TTL; common->flags = 0; - strncpy( (char *)common->community, community, N2N_COMMUNITY_SIZE ); + strncpy( (char *)common->community, community, N2N_COMMUNITY_SIZE); + common->community[N2N_COMMUNITY_SIZE - 1] = '\0'; } void print_common(char *test_name, n2n_common_t *common) {