+2005-10-23 Jerry DeLisle <jvdelisle@verizon.net>
+
+ PR libgfortran/24489
+ * io/transfer.c (read_block): Change the order of execution to not read
+ past end-of-record.
+ (read_block_direct): Same change.
+
2005-10-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/23272
char *source;
int nread;
- if (current_unit->flags.form == FORM_FORMATTED &&
- current_unit->flags.access == ACCESS_SEQUENTIAL)
- return read_sf (length); /* Special case. */
-
if (current_unit->bytes_left < *length)
{
if (current_unit->flags.pad == PAD_NO)
*length = current_unit->bytes_left;
}
+
+ if (current_unit->flags.form == FORM_FORMATTED &&
+ current_unit->flags.access == ACCESS_SEQUENTIAL)
+ return read_sf (length); /* Special case. */
current_unit->bytes_left -= *length;
void *data;
size_t nread;
- if (current_unit->flags.form == FORM_FORMATTED &&
- current_unit->flags.access == ACCESS_SEQUENTIAL)
- {
- length = (int*) nbytes;
- data = read_sf (length); /* Special case. */
- memcpy (buf, data, (size_t) *length);
- return;
- }
-
if (current_unit->bytes_left < *nbytes)
{
if (current_unit->flags.pad == PAD_NO)
*nbytes = current_unit->bytes_left;
}
+ if (current_unit->flags.form == FORM_FORMATTED &&
+ current_unit->flags.access == ACCESS_SEQUENTIAL)
+ {
+ length = (int*) nbytes;
+ data = read_sf (length); /* Special case. */
+ memcpy (buf, data, (size_t) *length);
+ return;
+ }
+
current_unit->bytes_left -= *nbytes;
nread = *nbytes;