From 0ad5c2c648d7a1e10771b2388b542ea516118622 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 12 Nov 2019 18:22:28 -0800 Subject: [PATCH] libiscsi: Fix a format specifier Use %lu to format unsigned long instead of %d. This was detected by Coverity. Signed-off-by: Bart Van Assche --- include/iscsi-private.h | 2 +- lib/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index dccd8c3..048aa01 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -361,7 +361,7 @@ void iscsi_decrement_iface_rr(void); } \ } while (0) -void +void __attribute__((format(printf, 3, 4))) iscsi_log_message(struct iscsi_context *iscsi, int level, const char *format, ...); void diff --git a/lib/init.c b/lib/init.c index 63487de..13098f0 100644 --- a/lib/init.c +++ b/lib/init.c @@ -289,7 +289,7 @@ iscsi_create_context(const char *initiator_name) while (iscsi->smalloc_size < required) { iscsi->smalloc_size <<= 1; } - ISCSI_LOG(iscsi,5,"small allocation size is %d byte", iscsi->smalloc_size); + ISCSI_LOG(iscsi,5,"small allocation size is %lu byte", iscsi->smalloc_size); ca = getenv("LIBISCSI_CACHE_ALLOCATIONS"); if (!ca || atoi(ca) != 0) {