]> git.proxmox.com Git - grub2.git/commitdiff
i18n: Format large integers before the translation message - take 2
authorDaniel Kiper <daniel.kiper@oracle.com>
Wed, 14 Apr 2021 15:18:06 +0000 (17:18 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 10 May 2021 13:06:33 +0000 (15:06 +0200)
This is an additional fix which has been missing from the commit 837fe48de
(i18n: Format large integers before the translation message).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
grub-core/kern/efi/mm.c

index 0cdb063bb1b6f186a24dd8801611c4c637394f48..9838fb2f50db39092e728423546b1bae03fb062b 100644 (file)
@@ -126,10 +126,14 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
   /* Limit the memory access to less than 4GB for 32-bit platforms.  */
   if (address > GRUB_EFI_MAX_USABLE_ADDRESS)
     {
+      char inv_addr[17], max_addr[17]; /* log16(2^64) = 16, plus NUL. */
+
+      grub_snprintf (inv_addr, sizeof (inv_addr) - 1, "%" PRIxGRUB_UINT64_T,
+                    address);
+      grub_snprintf (max_addr, sizeof (max_addr) - 1, "%" PRIxGRUB_UINT64_T,
+                    (grub_efi_uint64_t) GRUB_EFI_MAX_USABLE_ADDRESS);
       grub_error (GRUB_ERR_BAD_ARGUMENT,
-                 N_("invalid memory address (0x%" PRIxGRUB_UINT64_T
-                     " > 0x%" PRIxGRUB_UINT64_T ")"),
-                 address, (grub_efi_uint64_t) GRUB_EFI_MAX_USABLE_ADDRESS);
+                 N_("invalid memory address (0x%s > 0x%s)"), inv_addr, max_addr);
       return NULL;
     }