From a596716d86e89ebec6c3b75d7158dec43d95b3e3 Mon Sep 17 00:00:00 2001 From: Binh-Minh Date: Wed, 17 Jul 2024 03:11:29 -0400 Subject: [PATCH] Fix Fortran test The C API H5Rget_attr_name incorrectly added 1 to the length of the referenced object's attribute name, so the Fortran API h5rget_attr_name_f removed 1 from the returned value to accommodate the incorrectness. This PR fixes H5Rget_attr_name so this workaround in h5rget_attr_name_f is no longer needed. --- fortran/src/H5Rff.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index ab803a7596a..cad9d3c8a0e 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -1180,8 +1180,6 @@ END FUNCTION H5Rget_attr_name c_name(1:1)(1:1) = C_NULL_CHAR name_len = H5Rget_attr_name(ref_ptr, c_name, 1_SIZE_T) IF(name_len.LT.0_SIZE_T) hdferr = H5I_INVALID_HID_F - ! Don't include the NULL term in the size - name_len = name_len - 1 ELSE l = INT(LEN(name)+1,SIZE_T) IF(H5Rget_attr_name(ref_ptr, c_name, l) .LT. 0_SIZE_T)THEN