diff options
Diffstat (limited to 'flang/runtime/edit-output.cpp')
| -rw-r--r-- | flang/runtime/edit-output.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/flang/runtime/edit-output.cpp b/flang/runtime/edit-output.cpp index 13ab91fc56ea..6b24c5648318 100644 --- a/flang/runtime/edit-output.cpp +++ b/flang/runtime/edit-output.cpp @@ -832,8 +832,11 @@ RT_API_ATTRS bool EditLogicalOutput( reinterpret_cast<const unsigned char *>(&truth), sizeof truth); case 'A': { // legacy extension int truthBits{truth}; - return EditCharacterOutput( - io, edit, reinterpret_cast<char *>(&truthBits), sizeof truthBits); + int len{sizeof truthBits}; + int width{edit.width.value_or(len)}; + return EmitRepeated(io, ' ', std::max(0, width - len)) && + EmitEncoded( + io, reinterpret_cast<char *>(&truthBits), std::min(width, len)); } default: io.GetIoErrorHandler().SignalError(IostatErrorInFormat, |
