fix bug in f2c string conversion detected by bound checking

This commit is contained in:
Axel Kohlmeyer
2024-03-18 10:27:38 -04:00
parent 505f7b3cb4
commit 41ee1efa13

View File

@ -3687,7 +3687,7 @@ CONTAINS
n = LEN_TRIM(f_string)
ptr = lammps_malloc(n+1)
CALL C_F_POINTER(ptr, c_string, [1])
CALL C_F_POINTER(ptr, c_string, [n+1])
DO i=1, n
c_string(i) = f_string(i:i)
END DO