]> granicus.if.org Git - strace/commitdiff
Fix preadv/pwritev offset decoding on ILP32 architectures
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 7 Aug 2014 11:42:46 +0000 (11:42 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 7 Aug 2014 11:42:46 +0000 (11:42 +0000)
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

diff --git a/io.c b/io.c
index 4377777331fb39b29cf71766e6affc8aab804e5b..7238a8fabb548c95e0c29b12cf71436c2afa19bc 100644 (file)
--- 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
 }