From eaeeee7a4a8adf1529d138209aa91351d5ba6f53 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 23 Nov 2024 17:38:07 -0500 Subject: Avoid using internal utility functions in tests --- test/lilv_test_utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/lilv_test_utils.c') diff --git a/test/lilv_test_utils.c b/test/lilv_test_utils.c index c3c47f0..3063449 100644 --- a/test/lilv_test_utils.c +++ b/test/lilv_test_utils.c @@ -189,3 +189,16 @@ lilv_create_temporary_directory(const char* pattern) return result; } + +char* +string_concat(const char* const head, const char* const tail) +{ + const size_t head_len = strlen(head); + const size_t tail_len = strlen(tail); + char* const result = (char*)calloc(1U, head_len + tail_len + 1U); + if (result) { + memcpy(result, head, head_len + 1U); + memcpy(result + head_len, tail, tail_len + 1U); + } + return result; +} -- cgit v1.2.1