[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2.06 RELEASE 1/3] i18n: Format large integers before the translat
From: |
Daniel Kiper |
Subject: |
[PATCH 2.06 RELEASE 1/3] i18n: Format large integers before the translation message - take 2 |
Date: |
Wed, 14 Apr 2021 17:48:11 +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>
---
grub-core/kern/efi/mm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 0cdb063bb..9838fb2f5 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -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;
}
--
2.11.0