diff --git a/flang/runtime/edit-input.cpp b/flang/runtime/edit-input.cpp index c4fa186e289db..e13e50fd3b10e 100644 --- a/flang/runtime/edit-input.cpp +++ b/flang/runtime/edit-input.cpp @@ -243,7 +243,7 @@ bool EditIntegerInput( if (sign == '-') { value = -value; } - if (any || !io.GetConnectionState().IsAtEOF()) { + if (any || !io.GetIoErrorHandler().InError()) { // The value is stored in the lower order bits on big endian platform. // When memcpy, shift the value to the higher order bit. auto shft{static_cast(sizeof(value.low())) - kind}; @@ -254,8 +254,10 @@ bool EditIntegerInput( } else { std::memcpy(n, &value, kind); // a blank field means zero } + return true; + } else { + return false; } - return any; } // Parses a REAL input number from the input source as a normalized