]> granicus.if.org Git - strace/commitdiff
evdev.c: fix bitset decoding
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 27 May 2016 00:41:51 +0000 (00:41 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 28 May 2016 00:56:47 +0000 (00:56 +0000)
* evdev.c (decode_bitset): Use umove_or_printaddr.

evdev.c

diff --git a/evdev.c b/evdev.c
index f86416bb1b049391f7624d21d302130caf2e100f..2a610dc7d8760bd90b0b96f2ba890b6242de55dd 100644 (file)
--- 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);