diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-12 00:52:45 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-12 00:52:45 +0000 |
commit | 3126523160507064043ff71d5796d8358d673f37 (patch) | |
tree | a1b6b54ae0aa9567942b0b8a26ecffe11505e66e /libgfortran/io/format.c | |
parent | 9a030a297a08bccd0771e0f9890f70505ffcafca (diff) | |
download | gcc-3126523160507064043ff71d5796d8358d673f37.tar.gz |
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/38439
* io/format.c (parse_format_list): Correct logic for FMT_F reading vs
writing. Code clean-up.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152657 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/format.c')
-rw-r--r-- | libgfortran/io/format.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index 7e46e3a25df..97bd2da77ba 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -933,7 +933,7 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok) tail->u.real.d = fmt->value; break; } - if (t == FMT_F || dtp->u.p.mode == WRITING) + if (t == FMT_F && dtp->u.p.mode == WRITING) { if (u != FMT_POSINT && u != FMT_ZERO) { @@ -941,13 +941,10 @@ parse_format_list (st_parameter_dt *dtp, bool *save_ok) goto finished; } } - else + else if (u != FMT_POSINT) { - if (u != FMT_POSINT) - { - fmt->error = posint_required; - goto finished; - } + fmt->error = posint_required; + goto finished; } tail->u.real.w = fmt->value; |