[PATCH 24/26] tests: Proper type conversion in keyctl test

Eugene Syromyatnikov evgsyr at gmail.com
Mon Oct 24 03:02:50 UTC 2016


* tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t
since kernel_ulong_t may be of different size.
---
 tests/keyctl.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/keyctl.c b/tests/keyctl.c
index a60dcfc..4b1e383 100644
--- a/tests/keyctl.c
+++ b/tests/keyctl.c
@@ -128,7 +128,8 @@ print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size,
 		else if (size == sizeof(uint32_t))
 			printf(fmt, (uint32_t)arg);
 		else
-			print_quoted_string_limit((void *)arg, size, rc);
+			print_quoted_string_limit((void *) (uintptr_t) arg,
+						  size, rc);
 	}
 }
 
-- 
1.7.10.4





More information about the Strace-devel mailing list