From: Dmitry V. Levin Date: Thu, 7 Aug 2014 11:42:46 +0000 (+0000) Subject: Fix preadv/pwritev offset decoding on ILP32 architectures X-Git-Tag: v4.9~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20b84a676939cd0c4769626b88a55400d28dfe67;p=strace 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. --- 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 }