Skip to content

Commit 2f9495e

Browse files
committed
fixed an uninitialized variable issue in get_current_line_from_file_stream
1 parent 2052479 commit 2f9495e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/json_value_module.F90

+4-1
Original file line numberDiff line numberDiff line change
@@ -10064,6 +10064,7 @@ subroutine get_current_line_from_file_stream(json,iunit,line)
1006410064
integer(IK) :: iend !! end position of current line
1006510065
integer(IK) :: ios !! file read `iostat` code
1006610066
character(kind=CK,len=1) :: c !! a character read from the file
10067+
logical :: done !! flag to exit the loop
1006710068

1006810069
istart = json%ipos
1006910070
do
@@ -10072,7 +10073,9 @@ subroutine get_current_line_from_file_stream(json,iunit,line)
1007210073
exit
1007310074
end if
1007410075
read(iunit,pos=istart,iostat=ios) c
10075-
if (c==newline .or. ios/=0) then
10076+
done = ios /= 0_IK
10077+
if (.not. done) done = c==newline
10078+
if (done) then
1007610079
if (istart/=1) istart = istart - 1
1007710080
exit
1007810081
end if

0 commit comments

Comments
 (0)