is_trim_ok (st_parameter_dt *dtp)
{
/* Check rank and stride. */
- if (dtp->internal_unit_desc
- && (GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc) > 1
- || GFC_DESCRIPTOR_STRIDE(dtp->internal_unit_desc, 0) != 1))
+ if (dtp->internal_unit_desc)
return false;
/* Format strings can not have 'BZ' or '/'. */
if (dtp->common.flags & IOPARM_DT_HAS_FORMAT)
{
iunit->rank = GFC_DESCRIPTOR_RANK (dtp->internal_unit_desc);
iunit->ls = (array_loop_spec *)
- xmalloc (iunit->rank * sizeof (array_loop_spec));
+ xmallocarray (iunit->rank, sizeof (array_loop_spec));
dtp->internal_unit_len *=
init_loop_spec (dtp->internal_unit_desc, iunit->ls, &start_record);
char *
filename_from_unit (int n)
{
- char *filename;
gfc_unit *u;
int c;
/* Get the filename. */
if (u != NULL)
- {
- filename = (char *) xmalloc (u->file_len + 1);
- unpack_filename (filename, u->file, u->file_len);
- return filename;
- }
+ return fc_strdup (u->file, u->file_len);
else
return (char *) NULL;
}