aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex_test_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/regex_test_lib.c')
-rw-r--r--src/regex/regex_test_lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c
index bd1a06a53..7becd567c 100644
--- a/src/regex/regex_test_lib.c
+++ b/src/regex/regex_test_lib.c
@@ -392,7 +392,10 @@ regex_split (struct RegexCombineCtx *ctx,
392 char *suffix; 392 char *suffix;
393 393
394 suffix = GNUNET_malloc (len - prefix_l + 1); 394 suffix = GNUNET_malloc (len - prefix_l + 1);
395 strncpy (suffix, &ctx->s[prefix_l], len - prefix_l + 1); 395 /*
396 * We can use GNUNET_strlcpy because ctx->s is null-terminated
397 */
398 GNUNET_strlcpy (suffix, &ctx->s[prefix_l], len - prefix_l + 1);
396 399
397 /* Suffix saved, truncate current node so it only contains the prefix, 400 /* Suffix saved, truncate current node so it only contains the prefix,
398 * copy any children nodes to put as grandchildren and initialize new empty 401 * copy any children nodes to put as grandchildren and initialize new empty