2009-12-10 Vladimir Serbinenko <phcoder@gmail.com>

Eliminate hexdump 4Gib barrier.

	* commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_addr_t.
	* lib/arg.c (grub_arg_parse): Use grub_strtoull.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-12-10 14:37:42 +01:00
parent e1f270654e
commit 2520d4b815
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2009-12-10 Vladimir Serbinenko <phcoder@gmail.com>
Eliminate hexdump 4Gib barrier.
* commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_addr_t.
* lib/arg.c (grub_arg_parse): Use grub_strtoull.
2009-12-10 Vladimir Serbinenko <phcoder@gmail.com>
* kern/device.c (grub_device_iterate): Ignore errors during first scan.

View File

@ -38,18 +38,18 @@ grub_cmd_hexdump (grub_extcmd_t cmd, int argc, char **args)
struct grub_arg_list *state = cmd->state;
char buf[GRUB_DISK_SECTOR_SIZE * 4];
grub_ssize_t size, length;
grub_addr_t skip;
grub_disk_addr_t skip;
int namelen;
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
namelen = grub_strlen (args[0]);
skip = (state[0].set) ? grub_strtoul (state[0].arg, 0, 0) : 0;
skip = (state[0].set) ? grub_strtoull (state[0].arg, 0, 0) : 0;
length = (state[1].set) ? grub_strtoul (state[1].arg, 0, 0) : 256;
if (!grub_strcmp (args[0], "(mem)"))
hexdump (skip, (char *) skip, length);
hexdump (skip, (char *) (grub_addr_t) skip, length);
else if ((args[0][0] == '(') && (args[0][namelen - 1] == ')'))
{
grub_disk_t disk;

View File

@ -355,7 +355,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
{
char *tail;
grub_strtoul (option, &tail, 0);
grub_strtoull (option, &tail, 0);
if (tail == 0 || tail == option || *tail != '\0' || grub_errno)
{
grub_error (GRUB_ERR_BAD_ARGUMENT,