diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2024-12-03 20:55:41 -0800 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2024-12-03 20:57:59 -0800 |
commit | 7a92ba766815c9a6b73593967a26fdfbebfc7e69 (patch) | |
tree | ddef29613de843209b5167062cc8610eff4ff8ae /libgfortran | |
parent | f36cb8c79d3479cf8c9d5233f3f9cc26b2c5c457 (diff) | |
download | gcc-7a92ba766815c9a6b73593967a26fdfbebfc7e69.zip gcc-7a92ba766815c9a6b73593967a26fdfbebfc7e69.tar.gz gcc-7a92ba766815c9a6b73593967a26fdfbebfc7e69.tar.bz2 |
Fortran: Fix B64.0 formatted write output.
PR fortran/117820
libgfortran/ChangeLog:
* io/write.c (write_b): Add test for zero needed by write_boz.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr117820.f90: New test.
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/io/write.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 2f414c6..ccb2b5c 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1392,6 +1392,10 @@ write_b (st_parameter_dt *dtp, const fnode *f, const char *source, int len) { n = extract_uint (source, len); p = btoa (n, itoa_buf, sizeof (itoa_buf)); + + /* Test for zero. Needed by write_boz. */ + if (n != 0) + n = 1; write_boz (dtp, f, p, n, len); } } |