Package: libiscsi / 1.12.0-2

iscsi-dd-format-string.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Michael Tokarev <mjt@tls.msk.ru>
Subject: iscsi-dd: fix format strings
To: <libiscsi@googlegroups.com>

Here's a fix for another 32/64 format string issue, in iscsi-dd.c.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

diff --git a/examples/iscsi-dd.c b/examples/iscsi-dd.c
index 4cc7c2b..23675da 100644
--- a/examples/iscsi-dd.c
+++ b/examples/iscsi-dd.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <poll.h>
 #include <getopt.h>
+#include <inttypes.h>
 #include "iscsi.h"
 #include "scsi-lowlevel.h"
 
@@ -79,7 +80,7 @@ void write_cb(struct iscsi_context *iscsi, int status, void *command_data, void
 	fill_read_queue(client);
 
 	if (client->progress) {
-		printf("\r%lu of %lu blocks transferred.", client->pos, client->src_num_blocks);
+		printf("\r%"PRIu64" of %"PRIu64" blocks transferred.", client->pos, client->src_num_blocks);
 	}
 
 	if ((client->in_flight == 0) && (client->pos == client->src_num_blocks)) {
@@ -378,7 +379,7 @@ int main(int argc, char *argv[])
 	}
 
 	if (client.src_num_blocks > client.dst_num_blocks) {
-		fprintf(stderr, "source LUN is bigger than destination (%lu > %lu sectors)\n", client.src_num_blocks, client.dst_num_blocks);
+		fprintf(stderr, "source LUN is bigger than destination (%"PRIu64" > %"PRIu64" sectors)\n", client.src_num_blocks, client.dst_num_blocks);
 		exit(10);
 	}