re PR libfortran/16291 (F2003 formatting of Inf /Nan on irix6.5)

PR fortran/16291
	* libgfortran/io/write.c: (write_float): Added length check.
	Remove pointless memset calls.

From-SVN: r84308
This commit is contained in:
Andreas Krebbel 2004-07-08 19:58:56 +00:00 committed by Paul Brook
parent 36c1b0def4
commit dbe81a8b25
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2004-07-08 Andreas Krebbel <krebbel1@de.ibm.com>
PR fortran/16291
* libgfortran/io/write.c: (write_float): Added length check.
Remove pointless memset calls.
2004-07-04 Bud Davis <bdavis9659@comcast.net>
Paul Brook <paul@codesourcery.com>
@ -5,9 +11,9 @@
* io/transfer.c(us_write): set recl for seq unform writes to max size.
* io/transfer.c(data_transfer_init): handle un-opened seq unform unit.
* io/unix.c(fd_alloc_w_at): handle requests at start, fd_flush at
right time.
right time.
* io/unix.c(is_seekable): set based upon the file/device, not the
method being used to access it (fd or mmap).
method being used to access it (fd or mmap).
* io/unix.c(fd_flush): don't set file_size if !seekable.
* io/unix.c(fd_truncate: ditto.

View File

@ -535,10 +535,10 @@ write_float (fnode *f, const char *source, int len)
memcpy(p + nb - 8, "Infinity", 8);
else
memcpy(p + nb - 3, "Inf", 3);
if (nb < 8)
memset(p + nb - 4, fin, 1);
if (nb < 8 && nb > 3)
p[nb - 4] = fin;
else if (nb > 8)
memset(p + nb - 9, fin, 1);
p[nb - 9] = fin;
}
else
memcpy(p + nb - 3, "NaN", 3);