memcpy instead of invidual bittoggle
The ioctls return the number of bytes copied into the destination, so just
copy them into the device state instead of individually flipping bits.
For easier review: rc is the return value of the EVIOCG* ioctl, which is
the number of bytes copied.
state variables must be initialized to 0 now, in case the kernel's FOO_MAX
is smaller than libevdev's FOO_MAX. If not initialized to 0, the bytes
between the two max values is undefined and we may end up generating bogus
events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>