Skip to content

Commit 26d0ac5

Browse files
committed
safe loop
1 parent 95a0a6a commit 26d0ac5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fpm_strings.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ pure subroutine split_lines_first_last(string, first, last)
575575
if (index(CR//LF, string(p:p)) == 0) then
576576
n = n + 1
577577
istart(n) = p
578-
do while (p <= slen .and. index(CR//LF, string(p:p)) == 0)
578+
do while (p <= slen)
579+
if (index(CR//LF, string(p:p)) == 0) exit
579580
p = p + 1
580581
end do
581582
iend(n) = p - 1

0 commit comments

Comments
 (0)