From c7c2cb6a13b134db337c604f534b31537079aaef Mon Sep 17 00:00:00 2001 From: Paul Wouters Date: Fri, 3 Feb 2017 19:19:42 -0500 Subject: [PATCH] better test-buffer patch --- libreswan-3.19-testbuf.patch | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/libreswan-3.19-testbuf.patch b/libreswan-3.19-testbuf.patch index 0c5795a..4f0cece 100644 --- a/libreswan-3.19-testbuf.patch +++ b/libreswan-3.19-testbuf.patch @@ -1,21 +1,28 @@ -diff -Naur libreswan-3.19-orig/programs/pluto/test_buffer.c libreswan-3.19/programs/pluto/test_buffer.c ---- libreswan-3.19-orig/programs/pluto/test_buffer.c 2017-01-15 14:34:34.000000000 -0500 -+++ libreswan-3.19/programs/pluto/test_buffer.c 2017-01-15 15:26:25.800866709 -0500 -@@ -67,7 +67,7 @@ +commit 13560e2c4d340056c4381e4216c49950a350ed0b +Author: D. Hugh Redelmeier +Date: Fri Feb 3 18:16:10 2017 -0500 + + 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) { loglog(RC_INTERNALERR, - "unexpected space or NUL character at offset %zu in hex buffer \"%s\" at \"%s\"\n", -- pos - string, string, pos); -+ (size_t)(pos - string), string, pos); +- "unexpected space or NUL character at offset %zu in hex buffer \"%s\" at \"%s\"\n", ++ "unexpected space or NUL character at offset %tu in hex buffer \"%s\" at \"%s\"\n", + pos - string, string, pos); exit_pluto(PLUTO_EXIT_NSS_FAIL); } - char *end; -@@ -75,7 +75,7 @@ +@@ -74,7 +74,7 @@ chunk_t decode_hex_to_chunk(const char *original, const char *string) + chunk.ptr[chunk.len] = strtoul(buf, &end, 16); if (end - buf != 2) { loglog(RC_INTERNALERR, - "invalid character at offset %zu in hex buffer \"%s\" at \"%s\"\n", -- pos-string, string, pos); -+ (size_t)(pos-string), string, pos); +- "invalid character at offset %zu in hex buffer \"%s\" at \"%s\"\n", ++ "invalid character at offset %tu in hex buffer \"%s\" at \"%s\"\n", + pos-string, string, pos); exit_pluto(PLUTO_EXIT_NSS_FAIL); } - chunk.len++;