diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index 22a6e00e5..7655788bb 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -312,7 +312,7 @@ subroutine HDF5_addAttribute_str(loc_id,attrLabel,attrValue,path) logical :: attrExists integer :: hdferr character(len=:), allocatable :: p - character(len=:,kind=C_CHAR), allocatable,target :: attrValue_ + character(len=len_trim(attrValue)+1,kind=C_CHAR), target :: attrValue_ type(c_ptr), target, dimension(1) :: ptr