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(
979
979
// or the end of the current record. Subtlety: the "remaining" count
980
980
// here is a dummy that's used to avoid the interpretation of separators
981
981
// in NextInField.
982
- Fortran::common::optional<int > remaining{length > 0 ? maxUTF8Bytes : 0 };
982
+ Fortran::common::optional<int > remaining{maxUTF8Bytes};
983
983
while (Fortran::common::optional<char32_t > next{
984
984
io.NextInField (remaining, edit)}) {
985
985
bool isSep{false };
@@ -1005,8 +1005,11 @@ static RT_API_ATTRS bool EditListDirectedCharacterInput(
1005
1005
if (isSep) {
1006
1006
remaining = 0 ;
1007
1007
} else {
1008
- *x++ = *next;
1009
- remaining = --length > 0 ? maxUTF8Bytes : 0 ;
1008
+ if (length > 0 ) {
1009
+ *x++ = *next;
1010
+ --length;
1011
+ }
1012
+ remaining = maxUTF8Bytes;
1010
1013
}
1011
1014
}
1012
1015
Fortran::runtime::fill_n (x, length, ' ' );
You can’t perform that action at this time.
0 commit comments