explicitly zeroing elements.
* grub-core/io/gzio.c (grub_gzio_open): Likewise.
* grub-core/io/lzopio.c (grub_lzopio_open): Remove explicit zeroing
of elements in a structure already allocated using grub_zalloc.
* grub-core/io/xzio.c (grub_xzio_open): Likewise.
+2013-01-07 Colin Watson <cjwatson@ubuntu.com>
+
+ * grub-core/io/bufio.c (grub_bufio_open): Use grub_zalloc instead of
+ explicitly zeroing elements.
+ * grub-core/io/gzio.c (grub_gzio_open): Likewise.
+ * grub-core/io/lzopio.c (grub_lzopio_open): Remove explicit zeroing
+ of elements in a structure already allocated using grub_zalloc.
+ * grub-core/io/xzio.c (grub_xzio_open): Likewise.
+
2013-01-07 Colin Watson <cjwatson@ubuntu.com>
* docs/grub.texi (grub_cpu): New subsection.
grub_file_t file;
grub_bufio_t bufio = 0;
- file = (grub_file_t) grub_malloc (sizeof (*file));
+ file = (grub_file_t) grub_zalloc (sizeof (*file));
if (! file)
return 0;
size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE :
io->size);
- bufio = grub_malloc (sizeof (struct grub_bufio) + size);
+ bufio = grub_zalloc (sizeof (struct grub_bufio) + size);
if (! bufio)
{
grub_free (file);
bufio->file = io;
bufio->block_size = size;
- bufio->buffer_len = 0;
- bufio->buffer_at = 0;
file->device = io->device;
- file->offset = 0;
file->size = io->size;
file->data = bufio;
- file->read_hook = 0;
file->fs = &grub_bufio_fs;
file->not_easily_seekable = io->not_easily_seekable;
grub_file_t file;
grub_gzio_t gzio = 0;
- file = (grub_file_t) grub_malloc (sizeof (*file));
+ file = (grub_file_t) grub_zalloc (sizeof (*file));
if (! file)
return 0;
gzio->file = io;
file->device = io->device;
- file->offset = 0;
file->data = gzio;
- file->read_hook = 0;
file->fs = &grub_gzio_fs;
file->not_easily_seekable = 1;
lzopio->file = io;
file->device = io->device;
- file->offset = 0;
file->data = lzopio;
- file->read_hook = 0;
file->fs = &grub_lzopio_fs;
file->size = GRUB_FILE_SIZE_UNKNOWN;
file->not_easily_seekable = 1;
}
xzio->file = io;
- xzio->saved_offset = 0;
file->device = io->device;
- file->offset = 0;
file->data = xzio;
- file->read_hook = 0;
file->fs = &grub_xzio_fs;
file->size = GRUB_FILE_SIZE_UNKNOWN;
file->not_easily_seekable = 1;
}
xzio->buf.in = xzio->inbuf;
- xzio->buf.in_pos = 0;
- xzio->buf.in_size = 0;
xzio->buf.out = xzio->outbuf;
- xzio->buf.out_pos = 0;
xzio->buf.out_size = XZBUFSIZ;
/* FIXME: don't test footer on not easily seekable files. */