From: Dmitry V. Levin Date: Fri, 27 May 2016 00:41:43 +0000 (+0000) Subject: evdev.c: fix decoding of struct input_id X-Git-Tag: v4.12~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e54f98a223d2a75df7d34c924a3baccd35530cb0;p=strace evdev.c: fix decoding of struct input_id * evdev.c (getid_ioctl): Use umove_or_printaddr. --- diff --git a/evdev.c b/evdev.c index 1ffad841..f86416bb 100644 --- a/evdev.c +++ b/evdev.c @@ -232,19 +232,20 @@ keycode_V2_ioctl(struct tcb *tcp, long arg) static int getid_ioctl(struct tcb *tcp, long arg) { + tprints(", "); + struct input_id id; - if (!verbose(tcp) || umove(tcp, arg, &id) < 0) - return 0; + if (!umove_or_printaddr(tcp, arg, &id)) + tprintf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id.bustype, + id.vendor, + id.product, + id.version); - tprintf(", {ID_BUS=%" PRIu16 ", ID_VENDOR=%" PRIu16, - id.bustype, id.vendor); - if (!abbrev(tcp)) { - tprintf(", ID_PRODUCT=%" PRIu16 ", ID_VERSION=%" PRIu16 "}", - id.product, id.version); - } else { - tprints(", ...}"); - } return 1; }