From d7ab603ba06eff13e29dcec400c42a82da370114 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Wed, 7 May 2014 16:10:40 +0400 Subject: [PATCH] format string cast ptrdiff on 32bit arch (#747262) Cast ptrdiff (diff between two pointers) to long to fix printfs. This fixes FTBFS on 32bit architectures. Signed-off-by: Michael Tokarev --- lib/discovery.c | 2 +- lib/login.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/discovery.c b/lib/discovery.c index 2cbcf62..a8f7432 100644 --- a/lib/discovery.c +++ b/lib/discovery.c @@ -134,7 +134,7 @@ iscsi_process_text_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, if (end == NULL) { iscsi_set_error(iscsi, "NUL not found after offset %ld " "when parsing discovery data", - ptr - in->data); + (long)(ptr - in->data)); pdu->callback(iscsi, SCSI_STATUS_ERROR, NULL, pdu->private_data); iscsi_free_discovery_addresses(iscsi, targets); diff --git a/lib/login.c b/lib/login.c index c524108..32c3c8c 100644 --- a/lib/login.c +++ b/lib/login.c @@ -996,7 +996,7 @@ iscsi_process_login_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, if (end == NULL) { iscsi_set_error(iscsi, "NUL not found after offset %ld " "when parsing login data", - (unsigned char *)ptr - in->data); + (long)((unsigned char *)ptr - in->data)); pdu->callback(iscsi, SCSI_STATUS_ERROR, NULL, pdu->private_data); return -1;