File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -979,7 +979,7 @@ static RT_API_ATTRS bool EditListDirectedCharacterInput(
979979 // or the end of the current record. Subtlety: the "remaining" count
980980 // here is a dummy that's used to avoid the interpretation of separators
981981 // in NextInField.
982- Fortran::common::optional<int > remaining{length > 0 ? maxUTF8Bytes : 0 };
982+ Fortran::common::optional<int > remaining{maxUTF8Bytes};
983983 while (Fortran::common::optional<char32_t > next{
984984 io.NextInField (remaining, edit)}) {
985985 bool isSep{false };
@@ -1005,8 +1005,11 @@ static RT_API_ATTRS bool EditListDirectedCharacterInput(
10051005 if (isSep) {
10061006 remaining = 0 ;
10071007 } else {
1008- *x++ = *next;
1009- remaining = --length > 0 ? maxUTF8Bytes : 0 ;
1008+ if (length > 0 ) {
1009+ *x++ = *next;
1010+ --length;
1011+ }
1012+ remaining = maxUTF8Bytes;
10101013 }
10111014 }
10121015 Fortran::runtime::fill_n (x, length, ' ' );
You can’t perform that action at this time.
0 commit comments