* evdev.c (evdev_read_ioctl): Fix printing of the string returned
in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests.
static int
evdev_read_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
{
- if (syserror(tcp))
- return 0;
-
/* fixed-number fixed-length commands */
switch (code) {
case EVIOCGVERSION:
case _IOC_NR(EVIOCGPHYS(0)):
case _IOC_NR(EVIOCGUNIQ(0)):
tprints(", ");
- printstr(tcp, arg, tcp->u_rval - 1);
+ if (syserror(tcp))
+ printaddr(arg);
+ else
+ printstr(tcp, arg, tcp->u_rval);
return 1;
# ifdef EVIOCGPROP
case _IOC_NR(EVIOCGPROP(0)):