better test-buffer patch
This commit is contained in:
parent
ee061f381a
commit
c7c2cb6a13
@ -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 <hugh@mimosa.com>
|
||||
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++;
|
||||
|
Loading…
Reference in New Issue
Block a user