diff options
Diffstat (limited to 'test/lilv_test_utils.c')
-rw-r--r-- | test/lilv_test_utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; +} |