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_uri_map.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/lilv_test_uri_map.h') diff --git a/test/lilv_test_uri_map.h b/test/lilv_test_uri_map.h index b4fba0f..d7f3e20 100644 --- a/test/lilv_test_uri_map.h +++ b/test/lilv_test_uri_map.h @@ -4,8 +4,6 @@ #ifndef LILV_TEST_URI_MAP_H #define LILV_TEST_URI_MAP_H -#include "../src/lilv_internal.h" - #include "lv2/urid/urid.h" #include "serd/serd.h" @@ -49,10 +47,12 @@ map_uri(LV2_URID_Map_Handle handle, const char* uri) } } + const size_t uri_len = strlen(uri); assert(serd_uri_string_has_scheme((const uint8_t*)uri)); map->uris = (char**)realloc(map->uris, ++map->n_uris * sizeof(char*)); - map->uris[map->n_uris - 1] = lilv_strdup(uri); + map->uris[map->n_uris - 1] = calloc(1, uri_len + 1); + memcpy(map->uris[map->n_uris - 1], uri, uri_len + 1); return map->n_uris; } -- cgit v1.2.1