From 14a810e6d87d03852b45bacf5d4444320d413b69 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 27 May 2016 00:41:51 +0000 Subject: [PATCH] evdev.c: fix bitset decoding * evdev.c (decode_bitset): Use umove_or_printaddr. --- evdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/evdev.c b/evdev.c index f86416bb..2a610dc7 100644 --- a/evdev.c +++ b/evdev.c @@ -253,8 +253,7 @@ static int decode_bitset(struct tcb *tcp, long arg, const struct xlat decode_nr[], const unsigned int max_nr, const char *dflt) { - if (!verbose(tcp)) - return 0; + tprints(", "); unsigned int size; if ((unsigned long) tcp->u_rval > max_nr) @@ -263,10 +262,10 @@ decode_bitset(struct tcb *tcp, long arg, const struct xlat decode_nr[], size = tcp->u_rval; char decoded_arg[size]; - if (umoven(tcp, arg, size, decoded_arg) < 0) - return 0; + if (umove_or_printaddr(tcp, arg, &decoded_arg)) + return 1; - tprints(", ["); + tprints("["); int bit_displayed = 0; int i = next_set_bit(decoded_arg, 0, size); -- 2.50.1