mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
a20aa15969
commit
39b2e20698
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue