aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2019-06-27 10:49:40 +0200
committerlurchi <lurchi@strangeplace.net>2019-06-27 10:49:40 +0200
commitb9771c5f5edcbeb965fa291a281943d866c3ddb6 (patch)
treee53141e844dfe7032d018cb5bfebd31fe02f7816 /src/regex
parent0e7c93c3a0a3aa966503a8ae4caf3a21914e4126 (diff)
downloadgnunet-b9771c5f5edcbeb965fa291a281943d866c3ddb6.tar.gz
gnunet-b9771c5f5edcbeb965fa291a281943d866c3ddb6.zip
use GNUNET_strlcpy instead of strncpy where possible
Diffstat (limited to 'src/regex')
-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