Skip to content

Commit 7b5f563

Browse files
committed
Guarded against array bounds error
1 parent e13b29b commit 7b5f563

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/csv_utilities.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ pure elemental function lowercase_character(c) result(c_lower)
226226
integer :: i !! index in uppercase array
227227

228228
i = index(upper,c)
229-
c_lower = merge(lower(i:i),c,i>0)
229+
! Guard against lower(0:0) when i = 0
230+
if (i > 0) then
231+
c_lower = merge(lower(i:i),c,i>0)
232+
end if
230233

231234
end function lowercase_character
232235
!*****************************************************************************************

0 commit comments

Comments
 (0)