summaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-helper-testbed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-helper-testbed.c')
-rw-r--r--src/testbed/gnunet-helper-testbed.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index c56a795a6..687a54bcd 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -374,10 +374,9 @@ tokenizer_cb (void *cls,
if (0 != hostname_size)
{
hostname = GNUNET_malloc (hostname_size + 1);
- /* intentionally use strncpy (hostname not null terminated) */
- (void) strncpy (hostname, ((char *) &msg[1]) + trusted_ip_size + 1,
- hostname_size);
- hostname[hostname_size] = '\0';
+ GNUNET_strlcpy (hostname,
+ ((char *) &msg[1]) + trusted_ip_size + 1,
+ hostname_size + 1);
}
/* unset GNUNET_TESTING_PREFIX if present as it is more relevant for testbed */
evstr = getenv (GNUNET_TESTING_PREFIX);