len = (leng > BUF_SIZE) ? BUF_SIZE : leng;
if (grub_disk_read (dev->disk, 0, skip, len, buf))
- grub_util_error (_("disk read fails at offset %lld, length %lld"),
- (long long) skip, (long long) len);
+ {
+ char *msg = grub_xasprintf (_("disk read fails at offset %lld, length %lld"),
+ (long long) skip, (long long) len);
+ grub_util_error ("%s", msg);
+ }
if (hook (skip, buf, len, hook_arg))
break;
if (skip > file->size)
{
- grub_util_error (_("invalid skip value %lld"), (unsigned long long) skip);
+ char *msg = grub_xasprintf (_("invalid skip value %lld"),
+ (unsigned long long) skip);
+ grub_util_error ("%s", msg);
return;
}
sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len);
if (sz < 0)
{
- grub_util_error (_("read error at offset %llu: %s"),
- (unsigned long long) ofs, grub_errmsg);
+ char *msg = grub_xasprintf (_("read error at offset %llu: %s"),
+ (unsigned long long) ofs, grub_errmsg);
+ grub_util_error ("%s", msg);
break;
}
static char buf_1[BUF_SIZE];
if ((int) fread (buf_1, 1, len, ff) != len)
{
- grub_util_error (_("read error at offset %llu: %s"),
- (unsigned long long) ofs, grub_errmsg);
+ char *msg = grub_xasprintf (_("read error at offset %llu: %s"),
+ (unsigned long long) ofs, grub_errmsg);
+ grub_util_error ("%s", msg);
return 1;
}
for (i = 0; i < len; i++, ofs++)
if (buf_1[i] != buf[i])
{
- grub_util_error (_("compare fail at offset %llu"),
- (unsigned long long) ofs);
+ char *msg = grub_xasprintf (_("compare fail at offset %llu"),
+ (unsigned long long) ofs);
+ grub_util_error ("%s", msg);
return 1;
}
}
- image_target->link_addr;
if (grub_host_to_target_addr (s->sh_addr)
!= image_target->link_addr)
- grub_util_error (_("`%s' is miscompiled: it's start address is 0x%llx"
- " instead of 0x%llx: ld.gold bug?"),
- kernel_path,
- (unsigned long long) grub_host_to_target_addr (s->sh_addr),
- (unsigned long long) image_target->link_addr);
+ {
+ char *msg
+ = grub_xasprintf (_("`%s' is miscompiled: it's start address is 0x%llx"
+ " instead of 0x%llx: ld.gold bug?"),
+ kernel_path,
+ (unsigned long long) grub_host_to_target_addr (s->sh_addr),
+ (unsigned long long) image_target->link_addr);
+ grub_util_error ("%s", msg);
+ }
}
section_addresses[i] = current_address;
current_address += grub_host_to_target_addr (s->sh_size);