From 30f99c544404bec844f4d77b59eab90e076b3479 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sat, 11 Jan 2025 14:04:46 -0800 Subject: [PATCH] Fix GCC warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../tests/check_dicom.c: In function ‘test_element_CS_multivalue_empty_fn’: ../tests/check_dicom.c:306:21: warning: allocation of insufficient size ‘1’ for type ‘char *’ with size ‘8’ [-Walloc-size] --- CHANGELOG.md | 1 + tests/check_dicom.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a06d3a8..2143853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * much faster read of files with an EOT but no FGS [pcram-techcyte] * add `dcm_filehandle_get_frame_number()` [jcupitt] * add DICOM catenation support [jcupitt] +* fix GCC compiler warning [bgilbert] ## 1.1.0, 28/3/24 diff --git a/tests/check_dicom.c b/tests/check_dicom.c index 56e9a85..20ad729 100644 --- a/tests/check_dicom.c +++ b/tests/check_dicom.c @@ -303,7 +303,7 @@ START_TEST(test_element_CS_multivalue_empty) uint32_t vm = 0; // since malloc(0) can be NULL on some platforms - char **values = malloc(1); + char **values = malloc(sizeof(char *)); DcmElement *element = dcm_element_create(NULL, tag, DCM_VR_CS); (void) dcm_element_set_value_string_multi(NULL, element, values, vm, true);