* include/grub/types.h: Define the C99-style PRIxGRUB_SIZE macro,

suitable for using within the format argument of printf when
converting grub_size_t.
* disk/usbms.c (grub_usbms_transfer): Use PRIxGRUB_SIZE rather than
"x" to convert grub_size_t arguments.
This commit is contained in:
Colin Watson 2010-07-02 18:04:54 +01:00
parent 4037210375
commit 50f0bcdab5
3 changed files with 18 additions and 2 deletions

View file

@ -312,7 +312,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
grub_dprintf ("usb", "buf:\n");
if (size <= 64)
for (i=0; i<size; i++)
grub_dprintf ("usb", "0x%02x: 0x%02x\n", i, buf[i]);
grub_dprintf ("usb", "0x%02" PRIxGRUB_SIZE ": 0x%02x\n", i, buf[i]);
else
grub_dprintf ("usb", "Too much data for debug print...\n");
}
@ -330,7 +330,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd,
/* Debug print of sent data. */
if (size <= 256)
for (i=0; i<size; i++)
grub_dprintf ("usb", "0x%02x: 0x%02x\n", i, buf[i]);
grub_dprintf ("usb", "0x%02" PRIxGRUB_SIZE ": 0x%02x\n", i, buf[i]);
else
grub_dprintf ("usb", "Too much data for debug print...\n");
}