better test-buffer patch

This commit is contained in:
Paul Wouters 2017-02-03 19:19:42 -05:00
parent ee061f381a
commit c7c2cb6a13

View File

@ -1,21 +1,28 @@
diff -Naur libreswan-3.19-orig/programs/pluto/test_buffer.c libreswan-3.19/programs/pluto/test_buffer.c commit 13560e2c4d340056c4381e4216c49950a350ed0b
--- libreswan-3.19-orig/programs/pluto/test_buffer.c 2017-01-15 14:34:34.000000000 -0500 Author: D. Hugh Redelmeier <hugh@mimosa.com>
+++ libreswan-3.19/programs/pluto/test_buffer.c 2017-01-15 15:26:25.800866709 -0500 Date: Fri Feb 3 18:16:10 2017 -0500
@@ -67,7 +67,7 @@
pluto: use %tu to format ptrdiff_t (%zu is for size_t)
diff --git a/programs/pluto/test_buffer.c b/programs/pluto/test_buffer.c
index 6f24aa1..9b4ed0b 100644
--- a/programs/pluto/test_buffer.c
+++ b/programs/pluto/test_buffer.c
@@ -66,7 +66,7 @@ chunk_t decode_hex_to_chunk(const char *original, const char *string)
buf[i] = '\0';
if (i != 2) { if (i != 2) {
loglog(RC_INTERNALERR, loglog(RC_INTERNALERR,
"unexpected space or NUL character at offset %zu in hex buffer \"%s\" at \"%s\"\n", - "unexpected space or NUL character at offset %zu in hex buffer \"%s\" at \"%s\"\n",
- pos - string, string, pos); + "unexpected space or NUL character at offset %tu in hex buffer \"%s\" at \"%s\"\n",
+ (size_t)(pos - string), string, pos); pos - string, string, pos);
exit_pluto(PLUTO_EXIT_NSS_FAIL); exit_pluto(PLUTO_EXIT_NSS_FAIL);
} }
char *end; @@ -74,7 +74,7 @@ chunk_t decode_hex_to_chunk(const char *original, const char *string)
@@ -75,7 +75,7 @@ chunk.ptr[chunk.len] = strtoul(buf, &end, 16);
if (end - buf != 2) { if (end - buf != 2) {
loglog(RC_INTERNALERR, loglog(RC_INTERNALERR,
"invalid character at offset %zu in hex buffer \"%s\" at \"%s\"\n", - "invalid character at offset %zu in hex buffer \"%s\" at \"%s\"\n",
- pos-string, string, pos); + "invalid character at offset %tu in hex buffer \"%s\" at \"%s\"\n",
+ (size_t)(pos-string), string, pos); pos-string, string, pos);
exit_pluto(PLUTO_EXIT_NSS_FAIL); exit_pluto(PLUTO_EXIT_NSS_FAIL);
} }
chunk.len++;