From 9e6cf91f4846314648c3a086846be17d339bdd9c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 5 Dec 2013 18:32:36 +1000 Subject: [PATCH] evdev: fix memcopy for calibration 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 --- src/evdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 81539c84..029f0290 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -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