From 26e1e979f598bda3b0e53fbcde7b2b26d443abe4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 24 Jul 2021 23:08:05 +0200 Subject: [PATCH] length is known --- src/HDF5_utilities.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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