]> granicus.if.org Git - strace/commitdiff
tests: proper type conversion in keyctl test
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 20 Oct 2016 22:38:47 +0000 (01:38 +0300)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 28 Oct 2016 23:54:01 +0000 (02:54 +0300)
* tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t
since kernel_ulong_t may be of different size.

tests/keyctl.c

index a60dcfcf3e40f863cc1d649dbfd4f1fdcdaead91..4b1e3833825196c1b107f0228b6b40258245caf0 100644 (file)
@@ -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);
        }
 }