2008-04-01 Pavel Roskin <proski@gnu.org>

* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek().  The
	later is obsolete, potentially dangerous and sets a bad example.
	* util/i386/efi/grub-mkimage.c (make_header): Likewise.
	* util/misc.c (grub_util_get_image_size): Likewise.
This commit is contained in:
proski 2008-04-02 01:49:18 +00:00
parent 2bb4fb47e8
commit 828a27686e
4 changed files with 11 additions and 6 deletions

View file

@ -145,8 +145,8 @@ grub_util_get_image_size (const char *path)
void
grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp)
{
if (fseek (fp, offset, SEEK_SET) == -1)
grub_util_error ("fseek failed");
if (fseeko (fp, offset, SEEK_SET) == -1)
grub_util_error ("seek failed");
if (fread (img, 1, size, fp) != size)
grub_util_error ("read failed");
@ -199,7 +199,7 @@ void
grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out)
{
grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset);
if (fseek (out, offset, SEEK_SET) == -1)
if (fseeko (out, offset, SEEK_SET) == -1)
grub_util_error ("seek failed");
if (fwrite (img, 1, size, out) != size)
grub_util_error ("write failed");