0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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:
reimar 2014-04-06 18:23:25 +00:00 committed by wm4
parent a20aa15969
commit 39b2e20698

View File

@ -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;