From 39b2e206985d5adf99f182f9338d5267c36fea30 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 6 Apr 2014 18:23:25 +0000 Subject: joystick: Fix incorrect pointer offset code. I have some doubts that short reads are even allowed/ possible for /dev/js*, does someone know for sure? git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@37132 b3059339-0415-0410-9bf9-f77b7e298cf2 --- input/joystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input/joystick.c') diff --git a/input/joystick.c b/input/joystick.c index 680c8d6a68..e119fc37c8 100644 --- a/input/joystick.c +++ b/input/joystick.c @@ -113,7 +113,7 @@ static int mp_input_joystick_read(void *pctx, int fd) { int l=0; while((unsigned int)l < sizeof(struct js_event)) { - int r = read(fd,&ev+l,sizeof(struct js_event)-l); + int r = read(fd,((char*)&ev)+l,sizeof(struct js_event)-l); if(r <= 0) { if(errno == EINTR) continue; -- cgit v1.2.3