diff --git a/ChangeLog b/ChangeLog index 2fa14ecd27..de9ab6e3c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-11-24 Simon Budig + + * modules/controller_linux_input.c: Accept >= 0 return values of the + ioctl() to figure out the device name. Apparently it is the number of + bytes written to the string, so we might omit the strlen() following, + but I don't like to rely on that... + 2004-11-24 Michael Natterer * libgimpwidgets/gimpcontroller.[ch]: guarded the whole header diff --git a/modules/controller_linux_input.c b/modules/controller_linux_input.c index 80a20c1beb..2165788ca0 100644 --- a/modules/controller_linux_input.c +++ b/modules/controller_linux_input.c @@ -361,7 +361,7 @@ linux_input_set_device (ControllerLinuxInput *controller, gchar name[256]; name[0] = '\0'; - if (ioctl (fd, EVIOCGNAME (sizeof (name)), name) == 0 && + if (ioctl (fd, EVIOCGNAME (sizeof (name)), name) >= 0 && strlen (name) > 0 && g_utf8_validate (name, -1, NULL)) {