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

@ -1,5 +1,10 @@
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.
* disk/loopback.c (options): Improve help for "--partitions".
* normal/arg.c (grub_arg_show_help): Fix spacing of the long

View file

@ -255,8 +255,8 @@ cmd_cmp (char *src, char *dest)
return;
}
if ((skip) && (fseek (ff, skip, SEEK_SET)))
grub_util_error ("fseek error.\n");
if ((skip) && (fseeko (ff, skip, SEEK_SET)))
grub_util_error ("seek error.\n");
read_file (src, cmp_hook);
fclose (ff);

View file

@ -829,7 +829,7 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address,
| GRUB_PE32_SCN_MEM_READ);
/* Write them out. */
if (fseek (out, 0, SEEK_SET) < 0)
if (fseeko (out, 0, SEEK_SET) < 0)
grub_util_error ("seek failed");
if (fwrite (&header, sizeof (header), 1, out) != 1

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");