Commit b349746f authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

Accept >= 0 return values of the ioctl() to figure out the device name.

2004-11-24  Simon Budig  <simon@gimp.org>

	* 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...
parent cfcb716d
2004-11-24 Simon Budig <simon@gimp.org>
* 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 <mitch@gimp.org>
* libgimpwidgets/gimpcontroller.[ch]: guarded the whole header
......
......@@ -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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment