From: Glenn Washburn Date: Fri, 5 Mar 2021 00:22:36 +0000 (-0600) Subject: grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t X-Git-Tag: grub-2.06-rc1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96c7645f4bd70fc30d1063840b5acf6890a322c;p=thirdparty%2Fgrub.git grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper --- diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index 41866c62d..90f82b2d3 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -484,13 +484,15 @@ grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, cons } if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) { - ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + ret = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Unsupported XTS block size: %" PRIuGRUB_SIZE, cipher->cipher->blocksize); goto err; } if (secondary_cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) { - ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported XTS block size: %d", + ret = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Unsupported XTS block size: %" PRIuGRUB_SIZE, secondary_cipher->cipher->blocksize); goto err; } @@ -501,7 +503,8 @@ grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, cons cipheriv = ciphermode + sizeof ("lrw-") - 1; if (cipher->cipher->blocksize != GRUB_CRYPTODISK_GF_BYTES) { - ret = grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported LRW block size: %d", + ret = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Unsupported LRW block size: %" PRIuGRUB_SIZE, cipher->cipher->blocksize); goto err; } @@ -523,7 +526,8 @@ grub_cryptodisk_setcipher (grub_cryptodisk_t crypt, const char *ciphername, cons { if (cipher->cipher->blocksize & (cipher->cipher->blocksize - 1) || cipher->cipher->blocksize == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "Unsupported benbi blocksize: %d", + grub_error (GRUB_ERR_BAD_ARGUMENT, + "Unsupported benbi blocksize: %" PRIuGRUB_SIZE, cipher->cipher->blocksize); /* FIXME should we return an error here? */ for (benbi_log = 0; diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c index 67394bb6f..8cff7be02 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -504,7 +504,7 @@ grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp) if (len < 4) { grub_error (GRUB_ERR_OUT_OF_RANGE, - "malformed EFI Device Path node has length=%d", len); + "malformed EFI Device Path node has length=%" PRIuGRUB_SIZE, len); return NULL; } diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c index 2e98947a0..2bd80f4db 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -164,7 +164,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) if (len < 4) { grub_error (GRUB_ERR_OUT_OF_RANGE, - "malformed EFI Device Path node has length=%d", len); + "malformed EFI Device Path node has length=%" PRIuGRUB_SIZE, len); return NULL; } diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c index d89ff0a7a..5f3290ce1 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -2110,7 +2110,8 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)), { grub_file_close (file); return grub_error (GRUB_ERR_BAD_OS, "your kOpenBSD supports ramdisk only" - " up to %u bytes, however you supplied a %u bytes one", + " up to %" PRIuGRUB_SIZE " bytes, however you supplied" + " a %" PRIuGRUB_SIZE " bytes one", openbsd_ramdisk.max_size, size); }