* io/transfer.c (write_block): Add test for end-of-file condition,
removed from mem_alloc_w_at. (next_record_w): Clean up checks for
NULL pointer returns from s_alloc_w.
* io/unix.c (mem_alloc_w_at): Remove call to generate_error end-of-file.
* io/write.c (write_float): Add checks for NULL pointer returns from
write_block calls. (write_integer): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105092
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-10-07 Jerry DeLisle <jvdelisle@verizon.net>
+
+ * io/transfer.c (write_block): Add test for end-of-file condition,
+ removed from mem_alloc_w_at. (next_record_w): Clean up checks for
+ NULL pointer returns from s_alloc_w.
+ * io/unix.c (mem_alloc_w_at): Remove call to generate_error end-of-file.
+ * io/write.c (write_float): Add checks for NULL pointer returns from
+ write_block calls. (write_integer): Same.
+
2005-10-03 Jakub Jelinek <jakub@redhat.com>
* runtime/memory.c (allocate_size): Malloc 1 byte if size == 0.
current_unit->bytes_left -= (gfc_offset)length;
dest = salloc_w (current_unit->s, &length);
+
+ if (dest == NULL)
+ {
+ generate_error (ERROR_END, NULL);
+ return NULL;
+ }
if (ioparm.size != NULL)
*ioparm.size += length;
{
bytes_left = (int) current_unit->bytes_left;
p = salloc_w (current_unit->s, &bytes_left);
- if (p != NULL)
+ if (p == NULL)
{
- memset(p, ' ', bytes_left);
- current_unit->bytes_left = current_unit->recl;
+ generate_error (ERROR_END, NULL);
+ return;
}
+ memset(p, ' ', bytes_left);
+ current_unit->bytes_left = current_unit->recl;
}
else
{
length = 1;
p = salloc_w (current_unit->s, &length);
+ if (p==NULL)
+ goto io_error;
}
}
else
return NULL;
if (m > s->file_length)
- {
- generate_error (ERROR_END, NULL);
- return NULL;
- }
+ return NULL;
s->logical_offset = m;
if (nb == 0) nb = 4;
p = write_block (nb);
+ if (p == NULL)
+ return;
if (nb < 3)
{
memset (p, '*',nb);
if (nb > 0)
{
p = write_block (nb);
+ if (p == NULL)
+ return;
memset (p, ' ', nb);
}
}
if(width < digits )
width = digits ;
p = write_block (width) ;
+ if (p == NULL)
+ return;
if (no_leading_blank)
{
memcpy (p, q, digits);
}
else
{
- memset(p ,' ', width - digits) ;
- memcpy (p + width - digits, q, digits);
+ memset(p ,' ', width - digits) ;
+ memcpy (p + width - digits, q, digits);
}
}