From 89a0a0b232d7f90fe0cd4e35b6d28fe0f0fea3b7 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 23 Sep 2022 16:28:19 +0200 Subject: [PATCH] plugins/micron-nvme: Use correct print format specifier for sizeof arguments Signed-off-by: Daniel Wagner --- plugins/micron/micron-nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/micron/micron-nvme.c b/plugins/micron/micron-nvme.c index 90f03a27..e6f3a8cf 100644 --- a/plugins/micron/micron-nvme.c +++ b/plugins/micron/micron-nvme.c @@ -2963,7 +2963,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size) if (hdr.log_size == sizeof(hdr)) { buffer = (uint8_t *)malloc(sizeof(hdr)); if (buffer == NULL) { - fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n", + fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n", sizeof(hdr), id); return -ENOMEM; } @@ -2971,7 +2971,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size) } else if (hdr.log_size < hdr.max_size) { buffer = (uint8_t *)malloc(sizeof(hdr) + hdr.log_size); if (buffer == NULL) { - fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n", + fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n", hdr.log_size + sizeof(hdr), id); return -ENOMEM; } @@ -2989,7 +2989,7 @@ static int get_common_log(int fd, uint8_t id, uint8_t **buf, int *size) */ buffer = (uint8_t *)malloc(hdr.max_size + sizeof(hdr)); if (buffer == NULL) { - fprintf(stderr, "malloc of %lu bytes failed for log: 0x%X\n", + fprintf(stderr, "malloc of %zu bytes failed for log: 0x%X\n", hdr.max_size + sizeof(hdr), id); return -ENOMEM; } -- 2.50.1