From: Dmitry V. Levin Date: Fri, 27 May 2016 00:41:51 +0000 (+0000) Subject: evdev.c: fix bitset decoding X-Git-Tag: v4.12~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14a810e6d87d03852b45bacf5d4444320d413b69;p=strace evdev.c: fix bitset decoding * evdev.c (decode_bitset): Use umove_or_printaddr. --- 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);