From 20b84a676939cd0c4769626b88a55400d28dfe67 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 7 Aug 2014 11:42:46 +0000 Subject: [PATCH] Fix preadv/pwritev offset decoding on ILP32 architectures This fixes regression introduced by the previous commit. * io.c (print_llu_from_low_high_val) [SIZEOF_LONG != SIZEOF_LONG_LONG]: Cast argument to unsigned long before casting it to unsigned long long. --- io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io.c b/io.c index 43777773..7238a8fa 100644 --- a/io.c +++ b/io.c @@ -223,7 +223,7 @@ static void print_llu_from_low_high_val(struct tcb *tcp, int arg) { #if SIZEOF_LONG == SIZEOF_LONG_LONG - tprintf("%llu", (unsigned long long) tcp->u_arg[arg]); + tprintf("%lu", (unsigned long) tcp->u_arg[arg]); #elif defined(LINUX_MIPSN32) tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]); #else @@ -233,8 +233,8 @@ print_llu_from_low_high_val(struct tcb *tcp, int arg) else # endif tprintf("%llu", - ((unsigned long long) tcp->u_arg[arg + 1] << (sizeof(long) * 8)) - | (unsigned long long) tcp->u_arg[arg]); + ((unsigned long long) (unsigned long) tcp->u_arg[arg + 1] << sizeof(long) * 8) + | (unsigned long long) (unsigned long) tcp->u_arg[arg]); #endif } -- 2.40.0