diff options
author | David Robillard <d@drobilla.net> | 2024-11-23 17:38:07 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-24 13:21:57 -0500 |
commit | eaeeee7a4a8adf1529d138209aa91351d5ba6f53 (patch) | |
tree | 90f434a06742f6399d38dc4c37c9ac992c251185 /test/lilv_test_uri_map.h | |
parent | 918270bb6b8122bdc41ead0c304363b85a795b29 (diff) | |
download | lilv-eaeeee7a4a8adf1529d138209aa91351d5ba6f53.tar.gz lilv-eaeeee7a4a8adf1529d138209aa91351d5ba6f53.tar.bz2 lilv-eaeeee7a4a8adf1529d138209aa91351d5ba6f53.zip |
Avoid using internal utility functions in tests
Diffstat (limited to 'test/lilv_test_uri_map.h')
-rw-r--r-- | test/lilv_test_uri_map.h | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |