From 66be067e6137150dff3e5d26a127450c7f111c00 Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Wed, 14 Apr 2021 17:18:06 +0200 Subject: [PATCH] i18n: Format large integers before the translation message - take 2 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 Reviewed-by: Javier Martinez Canillas --- 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.39.5