evdev: fix memcopy for calibration
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 5 Dec 2013 08:32:36 +0000 (18:32 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 6 Dec 2013 03:52:16 +0000 (13:52 +1000)
Function arguments with fixed length are still just pointers, so
sizeof(calibration) here is sizeof(float*), not sizeof(float) * 6.

evdev.c: In function 'evdev_device_calibrate':
evdev.c:693:54: warning: argument to 'sizeof' in 'memcpy' call is the same
  pointer type 'float *' as the destination; expected 'float' or an explicit
  length [-Wsizeof-pointer-memaccess]
  memcpy(device->abs.calibration, calibration, sizeof calibration);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev.c

index 81539c8..029f029 100644 (file)
@@ -690,7 +690,7 @@ void
 evdev_device_calibrate(struct evdev_device *device, float calibration[6])
 {
        device->abs.apply_calibration = 1;
-       memcpy(device->abs.calibration, calibration, sizeof calibration);
+       memcpy(device->abs.calibration, calibration, sizeof device->abs.calibration);
 }
 
 void