[MPlayer-cvslog] r37132 - trunk/input/joystick.c

reimar subversion at mplayerhq.hu
Sun Apr 6 20:23:25 CEST 2014


Author: reimar
Date: Sun Apr  6 20:23:25 2014
New Revision: 37132

Log:
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?

Modified:
   trunk/input/joystick.c

Modified: trunk/input/joystick.c
==============================================================================
--- trunk/input/joystick.c	Sun Apr  6 20:18:01 2014	(r37131)
+++ trunk/input/joystick.c	Sun Apr  6 20:23:25 2014	(r37132)
@@ -95,7 +95,7 @@ int mp_input_joystick_read(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;


More information about the MPlayer-cvslog mailing list